[PATCH] D27129: [SelectionDAG] Add partial BITCAST support to computeKnownBits

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 14:20:35 PST 2016


efriedma added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2174
+        if (DemandedElts[i])
+          SubDemandedElts.setBit(i * SubScale);
+
----------------
(Phabricator won't let me delete this.)


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2176
+
+      bool IsLE = getDataLayout().isLittleEndian();
+      for (unsigned i = 0; i != SubScale; ++i) {
----------------
No testcase for a big-endian target?


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2179
+        computeKnownBits(N0, KnownZero2, KnownOne2, SubDemandedElts.shl(i),
+                         Depth + 1);
+        unsigned SubIdx = (IsLE ? i : (SubScale - (i + 1)));
----------------
You're calling computeKnownBits multiple times with different SubDemandedElts to try and get more resolution out of it?  Does that actually do anything useful in practice, as opposed to calling it once?  If it does, please put the explanation in a comment.


Repository:
  rL LLVM

https://reviews.llvm.org/D27129





More information about the llvm-commits mailing list