[llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp

Chris Lattner sabre at nondot.org
Sun Apr 15 12:53:14 PDT 2007



Changes in directory llvm/lib/Analysis:

ScalarEvolution.cpp updated: 1.109 -> 1.110
---
Log message:

Fix a nasty bug introduced when apint'ified.  This fixes
Transforms/IndVarsSimplify/exit_value_tests.llx


---
Diffs of the changes:  (+4 -4)

 ScalarEvolution.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/lib/Analysis/ScalarEvolution.cpp
diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.109 llvm/lib/Analysis/ScalarEvolution.cpp:1.110
--- llvm/lib/Analysis/ScalarEvolution.cpp:1.109	Sat Apr  7 12:48:27 2007
+++ llvm/lib/Analysis/ScalarEvolution.cpp	Sun Apr 15 14:52:49 2007
@@ -2096,9 +2096,9 @@
   }
 
   uint32_t BitWidth = LC->getValue()->getValue().getBitWidth();
-  const APInt& L = LC->getValue()->getValue();
-  const APInt& M = MC->getValue()->getValue();
-  const APInt& N = MC->getValue()->getValue();
+  const APInt &L = LC->getValue()->getValue();
+  const APInt &M = MC->getValue()->getValue();
+  const APInt &N = NC->getValue()->getValue();
   APInt Two(BitWidth, 2);
   APInt Four(BitWidth, 4);
 
@@ -2125,7 +2125,7 @@
     // Compute the two solutions for the quadratic formula. 
     // The divisions must be performed as signed divisions.
     APInt NegB(-B);
-    APInt TwoA( A * Two );
+    APInt TwoA(A << 1);
     ConstantInt *Solution1 = ConstantInt::get((NegB + SqrtVal).sdiv(TwoA));
     ConstantInt *Solution2 = ConstantInt::get((NegB - SqrtVal).sdiv(TwoA));
 






More information about the llvm-commits mailing list