[llvm-commits] [llvm] r53762 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Owen Anderson
resistor at mac.com
Fri Jul 18 11:03:38 PDT 2008
Author: resistor
Date: Fri Jul 18 13:03:38 2008
New Revision: 53762
URL: http://llvm.org/viewvc/llvm-project?rev=53762&view=rev
Log:
Make PRE actually handle critical edges (by splitting them). Confirmed that bootstrap passes with this change.
Modified:
llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=53762&r1=53761&r2=53762&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Jul 18 13:03:38 2008
@@ -1136,8 +1136,11 @@
changed |= shouldContinue;
}
- if (EnablePRE)
- changed |= performPRE(F);
+ if (EnablePRE) {
+ bool PREChanged = false;
+ while (PREChanged = performPRE(F))
+ changed |= PREChanged;
+ }
return changed;
}
@@ -1336,7 +1339,7 @@
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
More information about the llvm-commits
mailing list