Skip to content

Commit 0c783be

Browse files
committed
[TargetLowering] Use APInt::isSubsetOf to simplify an expression. NFC
1 parent 109f2f0 commit 0c783be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5145,7 +5145,7 @@ SDValue TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
51455145
N0.getOpcode() == ISD::AND && N0.hasOneUse()) {
51465146
if (auto *AndRHS = dyn_cast<ConstantSDNode>(N0.getOperand(1))) {
51475147
const APInt &AndRHSC = AndRHS->getAPIntValue();
5148-
if (AndRHSC.isNegatedPowerOf2() && (AndRHSC & C1) == C1) {
5148+
if (AndRHSC.isNegatedPowerOf2() && C1.isSubsetOf(AndRHSC)) {
51495149
unsigned ShiftBits = AndRHSC.countr_zero();
51505150
if (!TLI.shouldAvoidTransformToShift(ShValTy, ShiftBits)) {
51515151
SDValue Shift = DAG.getNode(

0 commit comments

Comments
 (0)