aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-14 17:32:56 +0000
committerChris Lattner <sabre@nondot.org>2005-09-14 17:32:56 +0000
commit6e2f8431144e519d968e410d8a56bfea7c2ae5bc (patch)
tree87c5cf6bf90bcc2ad13d6393af580f7048a85f6b
parent3452d23c34aec3b8735184c2ed7a2674aa96d80b (diff)
Fix the regression last night compiling povray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23348 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index a109540618..13c0977cb3 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -4749,7 +4749,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
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 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
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);