[llvm] b065902 - [X86] combineBT - use SimplifyDemandedBits instead of GetDemandedBits

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 06:27:52 PST 2020


Author: Simon Pilgrim
Date: 2020-01-21T14:24:46Z
New Revision: b065902ed4587faec5358e8aaef4570d3da83d40

URL: https://github.com/llvm/llvm-project/commit/b065902ed4587faec5358e8aaef4570d3da83d40
DIFF: https://github.com/llvm/llvm-project/commit/b065902ed4587faec5358e8aaef4570d3da83d40.diff

LOG: [X86] combineBT - use SimplifyDemandedBits instead of GetDemandedBits

Another step towards removing SelectionDAG::GetDemandedBits entirely

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index fe18f0bc079f..354a6a056bd8 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -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();
 }


        


More information about the llvm-commits mailing list