aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 5623776158..70506e32fc 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -4009,7 +4009,8 @@ static bool SinkInvariantGEPIndex(BinaryOperator *BinOp, LoopInfo *loopInfo,
// Check if it is possible to fold the expression to address mode.
if (UseTy &&
- TLI.isLegalAddressExpression(Instruction::Add, BinOp->getOperand(0),
+ TLI.isLegalAddressExpression(BinOp->getOpcode(),
+ BinOp->getOperand(0),
BinOp->getOperand(1), UseTy)) {
DestBBs.insert(UserBB);
MadeChange = true;