mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-27 15:29:51 +00:00
cache dereferenced iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108132 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a8b9df7bd9
commit
f1b2874c68
@ -432,9 +432,11 @@ static bool CanPropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
|
||||
// Use that list to make another list of common predecessors of BB and Succ
|
||||
BlockSet CommonPreds;
|
||||
for (pred_iterator PI = pred_begin(Succ), PE = pred_end(Succ);
|
||||
PI != PE; ++PI)
|
||||
if (BBPreds.count(*PI))
|
||||
CommonPreds.insert(*PI);
|
||||
PI != PE; ++PI) {
|
||||
BasicBlock *P = *PI;
|
||||
if (BBPreds.count(P))
|
||||
CommonPreds.insert(P);
|
||||
}
|
||||
|
||||
// Shortcut, if there are no common predecessors, merging is always safe
|
||||
if (CommonPreds.empty())
|
||||
|
Loading…
Reference in New Issue
Block a user