[llvm-commits] [llvm] r128781 - /llvm/trunk/lib/Analysis/ValueTracking.cpp

Eli Friedman eli.friedman at gmail.com
Sat Apr 2 15:11:56 PDT 2011


Author: efriedma
Date: Sat Apr  2 17:11:56 2011
New Revision: 128781

URL: http://llvm.org/viewvc/llvm-project?rev=128781&view=rev
Log:
Don't assume something which might be a constant expression is an instruction.
Based on PR9429, but no testcase because I can't figure out how to trigger it
anymore given other changes to the relevant code.


Modified:
    llvm/trunk/lib/Analysis/ValueTracking.cpp

Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=128781&r1=128780&r2=128781&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Sat Apr  2 17:11:56 2011
@@ -729,9 +729,9 @@
   // copying a sign bit (sdiv int_min, 2).
   if (match(V, m_LShr(m_Value(), m_Value())) ||
       match(V, m_UDiv(m_Value(), m_Value()))) {
-    BinaryOperator *BO = cast<BinaryOperator>(V);
-    if (BO->isExact())
-      return isPowerOfTwo(BO->getOperand(0), TD, Depth);
+    PossiblyExactOperator *PEO = cast<PossiblyExactOperator>(V);
+    if (PEO->isExact())
+      return isPowerOfTwo(PEO->getOperand(0), TD, Depth);
   }
 
   return false;





More information about the llvm-commits mailing list