mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
When GVN needs to split critical edges for load PRE, check all of the
predecessors before returning. Otherwise, if multiple predecessor edges need splitting, we only get one of them per iteration. This makes a small but measurable compile time improvement with -enable-full-load-pre. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97521 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8b30b8dd33
commit
70704978af
@ -1580,6 +1580,7 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
|
||||
for (unsigned i = 0, e = UnavailableBlocks.size(); i != e; ++i)
|
||||
FullyAvailableBlocks[UnavailableBlocks[i]] = false;
|
||||
|
||||
bool NeedToSplitEdges = false;
|
||||
for (pred_iterator PI = pred_begin(LoadBB), E = pred_end(LoadBB);
|
||||
PI != E; ++PI) {
|
||||
BasicBlock *Pred = *PI;
|
||||
@ -1596,9 +1597,11 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
|
||||
}
|
||||
unsigned SuccNum = GetSuccessorNumber(Pred, LoadBB);
|
||||
toSplit.push_back(std::make_pair(Pred->getTerminator(), SuccNum));
|
||||
NeedToSplitEdges = true;
|
||||
}
|
||||
}
|
||||
if (NeedToSplitEdges)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Decide whether PRE is profitable for this load.
|
||||
unsigned NumUnavailablePreds = PredLoads.size();
|
||||
|
Loading…
Reference in New Issue
Block a user