From 6e2f8431144e519d968e410d8a56bfea7c2ae5bc 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23348 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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); -- 2.34.1