[PATCH] D32569: [SelectionDAG] Use KnownBits struct in DAG's computeKnownBits and simplifyDemandedBits

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 07:21:08 PDT 2017


RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.

LGTM, I noticed a few APInt missed optimizations but nothing bound to this patch.



================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7182
                                  VT.getSizeInBits()));
-    if (TruncatedBits == (KnownZero & TruncatedBits)) {
+    if (TruncatedBits == (Known.Zero & TruncatedBits)) {
       if (VT.bitsGT(Op.getValueType()))
----------------
subsetof (as pre-commit)


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2316
+      Known.Zero = Known.Zero << *ShAmt;
+      Known.One = Known.One << *ShAmt;
       // Low bits are known zero.
----------------
<<= (pre-commit)


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:967
       // are demanded, turn this into an unsigned shift right.
-      if (KnownZero.intersects(SignMask) || (HighBits & ~NewMask) == HighBits) {
+      if (Known.Zero.intersects(SignMask) || (HighBits & ~NewMask) == HighBits) {
         SDNodeFlags Flags;
----------------
subsetof


https://reviews.llvm.org/D32569





More information about the llvm-commits mailing list