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

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 30 13:03:02 PST 2015


majnemer accepted this revision.
majnemer added a comment.
This revision is now accepted and ready to land.

LGTM


================
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())) ||
----------------
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.


http://reviews.llvm.org/D15827





More information about the llvm-commits mailing list