[PATCH] D15827: [ValueTracking] fix bug computing isKnownToBeAPowerOfTwo() with arithmetic shift right (PR25900)

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 30 13:54:02 PST 2015

spatel added inline comments.

Comment at: lib/Analysis/ValueTracking.cpp:1748-1749
@@ -1747,1 +1747,4 @@
+  // or zero.
+  // TODO: An arithmetic shift right of a power of two is a power of two or zero
+  // if the value is not the sign bit (minimum signed value).
   if (OrZero && (match(V, m_Shl(m_Value(X), m_Value())) ||
majnemer wrote:
> I wouldn't worry about this case here.  I think canonicalization should be responsible for making sure that an arithmetic shift right can be turned into a logical shift right.
Sounds good - I'll remove the TODO. Thanks for the prompt review!


More information about the llvm-commits mailing list