[PATCH] D12799: [ValueTracking] Teach isKnownNonZero a new trick

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 08:36:06 PDT 2015

jmolloy marked an inline comment as done.

Comment at: lib/Analysis/ValueTracking.cpp:1841
@@ +1840,3 @@
+      // Are all the bits to be shifted out known zero?
+      if (KnownZero.countTrailingOnes() >= ShiftVal)
+        return isKnownNonZero(X, DL, Depth, Q);
reames wrote:
> Shouldn't this be countTrailingZeros?
I don't think so, because bits in KnownZero are one if they are known to be zero. I agree it looks confusing though and I've made this mistake in the past.



More information about the llvm-commits mailing list