mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-21 12:38:45 +00:00
Fix a bug that prevented PRE from applying in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55744 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
72ab076e67
commit
0c7f91cf84
@ -1131,9 +1131,11 @@ bool GVN::runOnFunction(Function& F) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (EnablePRE) {
|
if (EnablePRE) {
|
||||||
bool PREChanged = false;
|
bool PREChanged = true;
|
||||||
while ((PREChanged = performPRE(F)))
|
while (PREChanged) {
|
||||||
|
PREChanged = performPRE(F);
|
||||||
changed |= PREChanged;
|
changed |= PREChanged;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
@ -1256,7 +1258,7 @@ bool GVN::performPRE(Function& F) {
|
|||||||
unsigned succNum = 0;
|
unsigned succNum = 0;
|
||||||
for (unsigned i = 0, e = PREPred->getTerminator()->getNumSuccessors();
|
for (unsigned i = 0, e = PREPred->getTerminator()->getNumSuccessors();
|
||||||
i != e; ++i)
|
i != e; ++i)
|
||||||
if (PREPred->getTerminator()->getSuccessor(i) == PREPred) {
|
if (PREPred->getTerminator()->getSuccessor(i) == CurrentBlock) {
|
||||||
succNum = i;
|
succNum = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user