diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-09 14:28:41 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-09 14:28:41 +0000 |
commit | 2732561be9bb280f25269c4ff1e92bdc1c28be8c (patch) | |
tree | 4783e513c3912234fa1dd2a47eb0851600cd77e6 /llvm/lib/Analysis/LoopInfo.cpp | |
parent | a02f232c1b1180043af679c128ed584b09d53df1 (diff) | |
download | bcm5719-llvm-2732561be9bb280f25269c4ff1e92bdc1c28be8c.tar.gz bcm5719-llvm-2732561be9bb280f25269c4ff1e92bdc1c28be8c.zip |
cache result of operator*
llvm-svn: 107967
Diffstat (limited to 'llvm/lib/Analysis/LoopInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopInfo.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp index 735e31f2524..818d0a9dd11 100644 --- a/llvm/lib/Analysis/LoopInfo.cpp +++ b/llvm/lib/Analysis/LoopInfo.cpp @@ -266,15 +266,16 @@ unsigned Loop::getSmallConstantTripMultiple() const { bool Loop::isLCSSAForm(DominatorTree &DT) const { // Sort the blocks vector so that we can use binary search to do quick // lookups. - SmallPtrSet<BasicBlock *, 16> LoopBBs(block_begin(), block_end()); + SmallPtrSet<BasicBlock*, 16> LoopBBs(block_begin(), block_end()); for (block_iterator BI = block_begin(), E = block_end(); BI != E; ++BI) { BasicBlock *BB = *BI; for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E;++I) for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; ++UI) { - BasicBlock *UserBB = cast<Instruction>(*UI)->getParent(); - if (PHINode *P = dyn_cast<PHINode>(*UI)) + User *U = *UI; + BasicBlock *UserBB = cast<Instruction>(U)->getParent(); + if (PHINode *P = dyn_cast<PHINode>(U)) UserBB = P->getIncomingBlock(UI); // Check the current block, as a fast-path, before checking whether |