]> granicus.if.org Git - llvm/commitdiff
[SelectionDAG] GetDemandedBits - update SIGN_EXTEND_INREG op to just call SimplifyMul...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 26 Jul 2019 10:03:07 +0000 (10:03 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 26 Jul 2019 10:03:07 +0000 (10:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367098 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 9774c5ebc9fca014fccd43468f9af60442040322..18955489f3d9f6280ddff90c7efd2ec6e79344c6 100644 (file)
@@ -2154,6 +2154,7 @@ SDValue SelectionDAG::GetDemandedBits(SDValue V, const APInt &DemandedBits,
   }
   case ISD::OR:
   case ISD::XOR:
+  case ISD::SIGN_EXTEND_INREG:
     return TLI->SimplifyMultipleUseDemandedBits(V, DemandedBits, DemandedElts,
                                                 *this, 0);
   case ISD::SRL:
@@ -2199,15 +2200,6 @@ SDValue SelectionDAG::GetDemandedBits(SDValue V, const APInt &DemandedBits,
       return getNode(ISD::ANY_EXTEND, SDLoc(V), V.getValueType(), DemandedSrc);
     break;
   }
-  case ISD::SIGN_EXTEND_INREG:
-    EVT ExVT = cast<VTSDNode>(V.getOperand(1))->getVT();
-    unsigned ExVTBits = ExVT.getScalarSizeInBits();
-
-    // If none of the extended bits are demanded, eliminate the sextinreg.
-    if (DemandedBits.getActiveBits() <= ExVTBits)
-      return V.getOperand(0);
-
-    break;
   }
   return SDValue();
 }