[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Sep 14 10:33:07 PDT 2005



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.370 -> 1.371
---
Log message:

Fix the regression last night compiling povray



---
Diffs of the changes:  (+3 -2)

 InstructionCombining.cpp |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.370 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.371
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.370	Tue Sep 13 13:36:04 2005
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Wed Sep 14 12:32:56 2005
@@ -4749,7 +4749,7 @@
           NewIdx = GEP.getOperand(1);
           Scale = ConstantInt::get(NewIdx->getType(), 1);
         } else if (ConstantInt *CI = dyn_cast<ConstantInt>(GEP.getOperand(1))) {
-          NewIdx = ConstantInt::get(NewIdx->getType(), 1);
+          NewIdx = ConstantInt::get(CI->getType(), 1);
           Scale = CI;
         } else if (Instruction *Inst =dyn_cast<Instruction>(GEP.getOperand(1))){
           if (Inst->getOpcode() == Instruction::Shl &&
@@ -4772,7 +4772,8 @@
         if (Scale && Scale->getRawValue() % ArrayEltSize == 0) {
           if (ConstantSInt *C = dyn_cast<ConstantSInt>(Scale))
             Scale = ConstantSInt::get(C->getType(),
-                                      C->getRawValue()/(int64_t)ArrayEltSize);
+                                      (int64_t)C->getRawValue() / 
+                                      (int64_t)ArrayEltSize);
           else
             Scale = ConstantUInt::get(Scale->getType(),
                                       Scale->getRawValue() / ArrayEltSize);






More information about the llvm-commits mailing list