Skip to content

Commit 6da8f3b

Browse files
committed
[X86] combinei64TruncSrlConstant - sink EVT::getIntegerVT to ISD::ADD case only. NFC.
Don't bother creating the CleanUpVT variable unless its being used by the getZeroExtendInReg call in the ISD::ADD case Noticed while triaging #141496
1 parent fb27867 commit 6da8f3b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54232,10 +54232,11 @@ static SDValue combinei64TruncSrlConstant(SDValue N, EVT VT, SelectionDAG &DAG,
5423254232
APInt NewOpConstVal = OpConst.lshr(SrlConst).trunc(VT.getSizeInBits());
5423354233
SDValue NewOpConst = DAG.getConstant(NewOpConstVal, DL, VT);
5423454234
SDValue NewOpNode = DAG.getNode(Opcode, DL, VT, Trunc, NewOpConst);
54235-
EVT CleanUpVT = EVT::getIntegerVT(*DAG.getContext(), 64 - SrlConstVal);
5423654235

54237-
if (Opcode == ISD::ADD)
54236+
if (Opcode == ISD::ADD) {
54237+
EVT CleanUpVT = EVT::getIntegerVT(*DAG.getContext(), 64 - SrlConstVal);
5423854238
return DAG.getZeroExtendInReg(NewOpNode, DL, CleanUpVT);
54239+
}
5423954240
return NewOpNode;
5424054241
}
5424154242

0 commit comments

Comments
 (0)