forked from OSchip/llvm-project
fix a bug I introduced in r80478 found by the build bot.
llvm-svn: 80482
This commit is contained in:
parent
97fd3599e1
commit
93ad6170fd
|
@ -11240,7 +11240,8 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
|||
Scale = ConstantInt::get(Scale->getType(),
|
||||
Scale->getZExtValue() / ArrayEltSize);
|
||||
if (Scale->getZExtValue() != 1) {
|
||||
Constant *C = ConstantExpr::getZExt(Scale, NewIdx->getType());
|
||||
Constant *C = ConstantExpr::getIntegerCast(Scale, NewIdx->getType(),
|
||||
false /*ZExt*/);
|
||||
Instruction *Sc = BinaryOperator::CreateMul(NewIdx, C, "idxscale");
|
||||
NewIdx = InsertNewInstBefore(Sc, GEP);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue