]> granicus.if.org Git - llvm/commitdiff
[TargetLowering] SimplifyDemandedBits - don't use OriginalDemanded variables in analysis.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 2 Jun 2019 10:12:55 +0000 (10:12 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 2 Jun 2019 10:12:55 +0000 (10:12 +0000)
These might have been replaced in multiple use cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362322 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/TargetLowering.cpp

index 43251d06ef1d90b3313540d204feafcd1112aa04..785530b3605b78b12d2c8687e2dc820dba2ab28c 100644 (file)
@@ -676,27 +676,27 @@ bool TargetLowering::SimplifyDemandedBits(
 
     // If index isn't constant, assume we need all vector elements AND the
     // inserted element.
-    APInt DemandedVecElts(OriginalDemandedElts);
+    APInt DemandedVecElts(DemandedElts);
     if (CIdx && CIdx->getAPIntValue().ult(VecVT.getVectorNumElements())) {
       unsigned Idx = CIdx->getZExtValue();
       DemandedVecElts.clearBit(Idx);
 
       // Inserted element is not required.
-      if (!OriginalDemandedElts[Idx])
+      if (!DemandedElts[Idx])
         return TLO.CombineTo(Op, Vec);
     }
 
     KnownBits KnownScl;
     unsigned NumSclBits = Scl.getScalarValueSizeInBits();
-    APInt DemandedSclBits = OriginalDemandedBits.zextOrTrunc(NumSclBits);
+    APInt DemandedSclBits = DemandedBits.zextOrTrunc(NumSclBits);
     if (SimplifyDemandedBits(Scl, DemandedSclBits, KnownScl, TLO, Depth + 1))
       return true;
 
     Known = KnownScl.zextOrTrunc(BitWidth, false);
 
     KnownBits KnownVec;
-    if (SimplifyDemandedBits(Vec, OriginalDemandedBits, DemandedVecElts,
-                             KnownVec, TLO, Depth + 1))
+    if (SimplifyDemandedBits(Vec, DemandedBits, DemandedVecElts, KnownVec, TLO,
+                             Depth + 1))
       return true;
 
     if (!!DemandedVecElts) {