From c7fe78d9a1b27c3f09963b7b28fcac71cf4eaf24 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 14 Sep 2005 17:32:56 +0000 Subject: [PATCH] Fix the regression last night compiling povray llvm-svn: 23348 --- lib/Transforms/Scalar/InstructionCombining.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index a1095406181..13c0977cb30 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(GEP.getOperand(1))) { - NewIdx = ConstantInt::get(NewIdx->getType(), 1); + NewIdx = ConstantInt::get(CI->getType(), 1); Scale = CI; } else if (Instruction *Inst =dyn_cast(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(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);