diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-12 15:48:26 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-12 15:48:26 +0000 |
commit | a9b8338bfa126de7ad6d57ca417b39d5c6a979ff (patch) | |
tree | 16fe0129f22e0f9146d64cbcdc3dd21589509dac /lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | |
parent | be4d10d7fa6f81eda360b451b4baabe64534c74e (diff) |
cache result of operator*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index 946c3ee0c7..8933a0b137 100644 --- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -525,17 +525,20 @@ bool InstCombiner::SimplifyStoreAtEndOfBlock(StoreInst &SI) { // Determine whether Dest has exactly two predecessors and, if so, compute // the other predecessor. pred_iterator PI = pred_begin(DestBB); + BasicBlock *P = *PI; BasicBlock *OtherBB = 0; - if (*PI != StoreBB) - OtherBB = *PI; - ++PI; - if (PI == pred_end(DestBB)) + + if (P != StoreBB) + OtherBB = P; + + if (++PI == pred_end(DestBB)) return false; - if (*PI != StoreBB) { + P = *PI; + if (P != StoreBB) { if (OtherBB) return false; - OtherBB = *PI; + OtherBB = P; } if (++PI != pred_end(DestBB)) return false; |