summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-05-22 07:03:34 +0000
committerChris Lattner <sabre@nondot.org>2011-05-22 07:03:34 +0000
commitf0d59072de69bcfd472827bcc687707ade3c960b (patch)
tree538de341f0c3eeca2ac844bbb0fa437bf39ddcec /llvm/lib/Transforms
parenta10327f5313601179c0ec599449fe1985f3277b1 (diff)
downloadbcm5719-llvm-f0d59072de69bcfd472827bcc687707ade3c960b.tar.gz
bcm5719-llvm-f0d59072de69bcfd472827bcc687707ade3c960b.zip
fix PR9841 by having GVN not process dead loads. This was
causing it to get into infinite loops when it would widen a load (which can necessarily leave around dead loads). llvm-svn: 131847
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index 1da5238bbb6..2515fd112c1 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -1607,6 +1607,11 @@ bool GVN::processLoad(LoadInst *L) {
if (L->isVolatile())
return false;
+ if (L->use_empty()) {
+ markInstructionForDeletion(L);
+ return true;
+ }
+
// ... to a pointer that has been loaded from before...
MemDepResult Dep = MD->getDependency(L);
OpenPOWER on IntegriCloud