[PATCH] D12958: Refactor computeKnownBits alignment handling code

Artur Pilipenko via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 08:22:51 PDT 2015


apilipenko added inline comments.

================
Comment at: lib/Analysis/ValueTracking.cpp:1488
@@ -1487,3 @@
-    KnownOne.clearAllBits();
-    return;
-  }
----------------
reames wrote:
> I'm not sure that removing these returns is actually equivalent.  Does computeKnownBits guarantee to preserve any known bits on entry?  (I don't think so?)  If not, then letting these flow down into the generic code may loose information. 
In all existing code paths computeKnownBits starts with cleared bits on both KnownZero and KnownOne. In my patch I just made it explicit by moving the lines which clear both bit sets before the code which handles aligned values. See line 1466.


http://reviews.llvm.org/D12958





More information about the llvm-commits mailing list