[llvm-commits] [llvm] r55744 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Owen Anderson
resistor at mac.com
Wed Sep 3 16:06:07 PDT 2008
Author: resistor
Date: Wed Sep 3 18:06:07 2008
New Revision: 55744
URL: http://llvm.org/viewvc/llvm-project?rev=55744&view=rev
Log:
Fix a bug that prevented PRE from applying in some cases.
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=55744&r1=55743&r2=55744&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Wed Sep 3 18:06:07 2008
@@ -1131,9 +1131,11 @@
}
if (EnablePRE) {
- bool PREChanged = false;
- while ((PREChanged = performPRE(F)))
+ bool PREChanged = true;
+ while (PREChanged) {
+ PREChanged = performPRE(F);
changed |= PREChanged;
+ }
}
return changed;
@@ -1256,7 +1258,7 @@
unsigned succNum = 0;
for (unsigned i = 0, e = PREPred->getTerminator()->getNumSuccessors();
i != e; ++i)
- if (PREPred->getTerminator()->getSuccessor(i) == PREPred) {
+ if (PREPred->getTerminator()->getSuccessor(i) == CurrentBlock) {
succNum = i;
break;
}
More information about the llvm-commits
mailing list