1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Fix the regression last night compiling povray

llvm-svn: 23348
This commit is contained in:
Chris Lattner 2005-09-14 17:32:56 +00:00
parent fa644b391f
commit c7fe78d9a1

View File

@ -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);