MemoryDepAnalysis is not used if redundant load processing is disabled.
llvm-svn: 97512
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index f7470c3..a7cc904 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -2237,7 +2237,7 @@
std::pair<TerminatorInst*, unsigned> Edge = toSplit.pop_back_val();
SplitCriticalEdge(Edge.first, Edge.second, this);
} while (!toSplit.empty());
- MD->invalidateCachedPredecessors();
+ if (MD) MD->invalidateCachedPredecessors();
return true;
}