[PATCH] D30379: [SelectionDAG] Make SelectionDAG aware of the known bits in UADDO and SADDO.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 5 02:21:50 PST 2017


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2505
+
+    computeKnownBits(Op.getOperand(0), KnownZero2, KnownOne2, DemandedElts,
+                     Depth + 1);
----------------
Add some description comments


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2508
+    unsigned KnownZeroLow = KnownZero2.countTrailingOnes();
+
+    computeKnownBits(Op.getOperand(1), KnownZero2, KnownOne2, DemandedElts,
----------------
Worth doing an early out here if KnownZeroLow == 0?


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2513
+                            KnownZero2.countTrailingOnes());
+    KnownZero |= APInt::getLowBitsSet(BitWidth, KnownZeroLow);
+    break;
----------------
KnownZero.setBits(0, KnownZeroLow);


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2523
+          BitWidth > 1)
+        KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - 1);
+      break;
----------------
KnownZero.setBits(1, BitWidth);


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2555
+      if (KnownZeroLow >= 2)
+        KnownZero |= APInt::getBitsSet(BitWidth, 1, KnownZeroLow);
       break;
----------------
KnownZero.setBit(1, KnownZeroLow);


https://reviews.llvm.org/D30379





More information about the llvm-commits mailing list