Skip to content

Commit 7163539

Browse files
committed
[DAGCombiner] When combining (sext_inreg (zext X), VT) -> (sext X) don't pass along the sext_inreg VT.
ISD::SIGN_EXTEND is only supposed to have one operand, but we were creating it with 2 operands. Since we basically never check for extra operands this went unnoticed.
1 parent 9d910b1 commit 7163539

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14076,7 +14076,7 @@ SDValue DAGCombiner::visitSIGN_EXTEND_INREG(SDNode *N) {
1407614076
SDValue N00 = N0.getOperand(0);
1407714077
if (N00.getScalarValueSizeInBits() == ExtVTBits &&
1407814078
(!LegalOperations || TLI.isOperationLegal(ISD::SIGN_EXTEND, VT)))
14079-
return DAG.getNode(ISD::SIGN_EXTEND, SDLoc(N), VT, N00, N1);
14079+
return DAG.getNode(ISD::SIGN_EXTEND, SDLoc(N), VT, N00);
1408014080
}
1408114081

1408214082
// fold (sext_in_reg x) -> (zext_in_reg x) if the sign bit is known zero.

0 commit comments

Comments
 (0)