diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-12 10:49:54 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-12 10:49:54 +0000 |
commit | d993402df30d8ca7cdefd2c5cd8ca4d99854b489 (patch) | |
tree | e6179b6b9ddfa8e7db33076b328fabc35d1087aa /llvm/lib/Transforms/Utils/Local.cpp | |
parent | 2a464d73082bb3b1375a178db9528d5860e57b28 (diff) | |
download | bcm5719-llvm-d993402df30d8ca7cdefd2c5cd8ca4d99854b489.tar.gz bcm5719-llvm-d993402df30d8ca7cdefd2c5cd8ca4d99854b489.zip |
cache dereferenced iterators
llvm-svn: 108132
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index b9fcfd5f5fe..0b48a8fce78 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -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()) |