[TargetLowering] SimplifyDemandedBits - Pull out InDemandedMask variable to ISD:...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 20 Jan 2020 17:37:20 +0000 (17:37 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 21 Jan 2020 10:40:18 +0000 (10:40 +0000)
Matches ISD::SRA + ISD::SRL variants.

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

index 96614bb..90be876 100644 (file)
@@ -1355,8 +1355,9 @@ bool TargetLowering::SimplifyDemandedBits(
         }
       }
 
-      if (SimplifyDemandedBits(Op0, DemandedBits.lshr(ShAmt), DemandedElts,
-                               Known, TLO, Depth + 1))
+      APInt InDemandedMask = DemandedBits.lshr(ShAmt);
+      if (SimplifyDemandedBits(Op0, InDemandedMask, DemandedElts, Known, TLO,
+                               Depth + 1))
         return true;
 
       // Try shrinking the operation as long as the shift amount will still be