Skip to content

Commit 1c87083

Browse files
Stephen YoungStephenYoung2754
authored andcommitted
[DAGCombiner] Fix type check in visitSRA: use VT for SIGN_EXTEND and TruncVT for TRUNCATE
1 parent 82ef4ee commit 1c87083

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10888,8 +10888,8 @@ SDValue DAGCombiner::visitSRA(SDNode *N) {
1088810888
// on that type, and the truncate to that type is both legal and free,
1088910889
// perform the transform.
1089010890
if ((ShiftAmt > 0) &&
10891-
TLI.isOperationLegalOrCustom(ISD::SIGN_EXTEND, TruncVT) &&
10892-
TLI.isOperationLegalOrCustom(ISD::TRUNCATE, VT) &&
10891+
TLI.isOperationLegalOrCustom(ISD::SIGN_EXTEND, VT) &&
10892+
TLI.isOperationLegalOrCustom(ISD::TRUNCATE, TruncVT) &&
1089310893
TLI.isTruncateFree(VT, TruncVT)) {
1089410894
SDValue Amt = DAG.getShiftAmountConstant(ShiftAmt, VT, DL);
1089510895
SDValue Shift = DAG.getNode(ISD::SRL, DL, VT,

0 commit comments

Comments
 (0)