diff options
| author | Chris Lattner <sabre@nondot.org> | 2011-05-22 07:03:34 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2011-05-22 07:03:34 +0000 | 
| commit | f0d59072de69bcfd472827bcc687707ade3c960b (patch) | |
| tree | 538de341f0c3eeca2ac844bbb0fa437bf39ddcec /llvm/lib/Transforms | |
| parent | a10327f5313601179c0ec599449fe1985f3277b1 (diff) | |
| download | bcm5719-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.cpp | 5 | 
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); | 

