diff options
author | Owen Anderson <resistor@mac.com> | 2008-07-18 18:03:38 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-07-18 18:03:38 +0000 |
commit | e98c54c47ca09207ef2d2d6065a512a6b0ed1f0d (patch) | |
tree | 482063f9044a083547d986ee1e4d06a9d7cbf724 | |
parent | cfa94198d5a75776a600df8113ac565b25552399 (diff) | |
download | external_llvm-e98c54c47ca09207ef2d2d6065a512a6b0ed1f0d.zip external_llvm-e98c54c47ca09207ef2d2d6065a512a6b0ed1f0d.tar.gz external_llvm-e98c54c47ca09207ef2d2d6065a512a6b0ed1f0d.tar.bz2 |
Make PRE actually handle critical edges (by splitting them). Confirmed that bootstrap passes with this change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53762 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 4e4d8c1..c664546 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -1136,8 +1136,11 @@ bool GVN::runOnFunction(Function& F) { changed |= shouldContinue; } - if (EnablePRE) - changed |= performPRE(F); + if (EnablePRE) { + bool PREChanged = false; + while (PREChanged = performPRE(F)) + changed |= PREChanged; + } return changed; } @@ -1336,7 +1339,7 @@ bool GVN::performPRE(Function& F) { I = toSplit.begin(), E = toSplit.end(); I != E; ++I) SplitCriticalEdge(I->first, I->second, this); - return changed; + return changed || toSplit.size(); } // iterateOnFunction - Executes one iteration of GVN |