Skip to content

Commit b065902

Browse files
committed
[X86] combineBT - use SimplifyDemandedBits instead of GetDemandedBits
Another step towards removing SelectionDAG::GetDemandedBits entirely
1 parent f651c40 commit b065902

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43175,14 +43175,13 @@ static SDValue combineAndnp(SDNode *N, SelectionDAG &DAG,
4317543175

4317643176
static SDValue combineBT(SDNode *N, SelectionDAG &DAG,
4317743177
TargetLowering::DAGCombinerInfo &DCI) {
43178-
SDValue N0 = N->getOperand(0);
4317943178
SDValue N1 = N->getOperand(1);
4318043179

4318143180
// BT ignores high bits in the bit index operand.
4318243181
unsigned BitWidth = N1.getValueSizeInBits();
4318343182
APInt DemandedMask = APInt::getLowBitsSet(BitWidth, Log2_32(BitWidth));
43184-
if (SDValue DemandedN1 = DAG.GetDemandedBits(N1, DemandedMask))
43185-
return DAG.getNode(X86ISD::BT, SDLoc(N), MVT::i32, N0, DemandedN1);
43183+
if (DAG.getTargetLoweringInfo().SimplifyDemandedBits(N1, DemandedMask, DCI))
43184+
return SDValue(N, 0);
4318643185

4318743186
return SDValue();
4318843187
}

0 commit comments

Comments
 (0)