summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index e40171a6b0d..d810615f4c5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -4009,7 +4009,7 @@ static bool SinkInvariantGEPIndex(BinaryOperator *BinOp, LoopInfo *loopInfo,
Loop *L = loopInfo->getLoopFor(UserBB);
// Only sink if expression is a loop invariant in the use BB.
- if (isLoopInvariantInst(BinOp, L) && !User->use_empty()) {
+ if (L && isLoopInvariantInst(BinOp, L) && !User->use_empty()) {
const Type *UseTy = NULL;
// FIXME: We are assuming all the uses of the GEP will have the
// same type.
OpenPOWER on IntegriCloud