Skip to content

Commit f53c2f6

Browse files
committed
[X86] combineSetCC - use getZExtOrTrunc() to perform the constant folding. NFCI
1 parent ad1b2a8 commit f53c2f6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53266,14 +53266,10 @@ static SDValue combineSetCC(SDNode *N, SelectionDAG &DAG,
5326653266
APInt UpperBits = APInt::getBitsSetFrom(SrcVT.getScalarSizeInBits(),
5326753267
OpVT.getScalarSizeInBits());
5326853268
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
53269-
auto *C = cast<ConstantSDNode>(RHS);
5327053269
if (DAG.MaskedValueIsZero(LHS.getOperand(0), UpperBits) &&
5327153270
TLI.isTypeLegal(LHS.getOperand(0).getValueType()))
5327253271
return DAG.getSetCC(DL, VT, LHS.getOperand(0),
53273-
DAG.getConstant(C->getAPIntValue().zextOrTrunc(
53274-
SrcVT.getScalarSizeInBits()),
53275-
DL, SrcVT),
53276-
CC);
53272+
DAG.getZExtOrTrunc(RHS, DL, SrcVT), CC);
5327753273
}
5327853274

5327953275
// With C as a power of 2 and C != 0 and C != INT_MIN:

0 commit comments

Comments
 (0)