diff options
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 6851015612..d906263a5b 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -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; |