summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-12 15:48:26 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-12 15:48:26 +0000
commit1b787df129b18f93a2d19a90b3c50f147318e4a4 (patch)
treeec0017ac08fab0f8add96bb7a476e0711d3f7456 /llvm/lib/Transforms
parent68d7424a65b146ad700e9dad1718846d041930c5 (diff)
downloadbcm5719-llvm-1b787df129b18f93a2d19a90b3c50f147318e4a4.tar.gz
bcm5719-llvm-1b787df129b18f93a2d19a90b3c50f147318e4a4.zip
cache result of operator*
llvm-svn: 108150
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 946c3ee0c78..8933a0b137a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud