Scale 1 is always ok.

llvm-svn: 35407
This commit is contained in:
Evan Cheng 2007-03-28 01:55:52 +00:00
parent c2cba18f2b
commit 4388043b25
1 changed files with 1 additions and 1 deletions

View File

@ -4137,7 +4137,7 @@ static bool SinkInvariantGEPIndex(BinaryOperator *BinOp,
int64_t Cst = cast<ConstantInt>(BinOp->getOperand(1))->getSExtValue();
// e.g. load (gep i32 * %P, (X+42)) => load (%P + X*4 + 168).
if (TLI.isLegalAddressImmediate(Cst*Scale, UseTy) &&
TLI.isLegalAddressScale(Scale, UseTy)) {
(Scale == 1 || TLI.isLegalAddressScale(Scale, UseTy))) {
DestBBs.insert(GEPIBB);
MadeChange = true;
break;