mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-19 08:24:12 +00:00
Fix the regression last night compiling povray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23348 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3452d23c34
commit
6e2f843114
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user