Commit b065902e authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

[X86] combineBT - use SimplifyDemandedBits instead of GetDemandedBits

Another step towards removing SelectionDAG::GetDemandedBits entirely
parent f651c402
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -43175,14 +43175,13 @@ static SDValue combineAndnp(SDNode *N, SelectionDAG &DAG,
static SDValue combineBT(SDNode *N, SelectionDAG &DAG,
                         TargetLowering::DAGCombinerInfo &DCI) {
  SDValue N0 = N->getOperand(0);
  SDValue N1 = N->getOperand(1);
  // BT ignores high bits in the bit index operand.
  unsigned BitWidth = N1.getValueSizeInBits();
  APInt DemandedMask = APInt::getLowBitsSet(BitWidth, Log2_32(BitWidth));
  if (SDValue DemandedN1 = DAG.GetDemandedBits(N1, DemandedMask))
    return DAG.getNode(X86ISD::BT, SDLoc(N), MVT::i32, N0, DemandedN1);
  if (DAG.getTargetLoweringInfo().SimplifyDemandedBits(N1, DemandedMask, DCI))
    return SDValue(N, 0);
  return SDValue();
}