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

Scale 1 is always ok.

llvm-svn: 35407
This commit is contained in:
Evan Cheng 2007-03-28 01:55:52 +00:00
parent a55449c051
commit 13cc34e91b

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;