summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-09 16:08:33 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-09 16:08:33 +0000
commit03f09a3e329abcb35c1a5aa3a4546668b1af21ee (patch)
tree3f9159460cbff2b34c263d23daca2eb4414f1d41 /lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
parentc654d1b8c195a13413537a668f669fd9b0c7f226 (diff)
downloadexternal_llvm-03f09a3e329abcb35c1a5aa3a4546668b1af21ee.zip
external_llvm-03f09a3e329abcb35c1a5aa3a4546668b1af21ee.tar.gz
external_llvm-03f09a3e329abcb35c1a5aa3a4546668b1af21ee.tar.bz2
cache result of operator*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107980 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 3030017..928e1ec 100644
--- a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -46,9 +46,11 @@ static bool isUsedOutsideOfDefiningBlock(const Instruction *I) {
if (isa<PHINode>(I)) return true;
const BasicBlock *BB = I->getParent();
for (Value::const_use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI)
- if (cast<Instruction>(*UI)->getParent() != BB || isa<PHINode>(*UI))
+ UI != E; ++UI) {
+ const User *U = *UI;
+ if (cast<Instruction>(U)->getParent() != BB || isa<PHINode>(U))
return true;
+ }
return false;
}
@@ -63,9 +65,11 @@ static bool isOnlyUsedInEntryBlock(const Argument *A, bool EnableFastISel) {
const BasicBlock *Entry = A->getParent()->begin();
for (Value::const_use_iterator UI = A->use_begin(), E = A->use_end();
- UI != E; ++UI)
- if (cast<Instruction>(*UI)->getParent() != Entry || isa<SwitchInst>(*UI))
+ UI != E; ++UI) {
+ const User *U = *UI;
+ if (cast<Instruction>(U)->getParent() != Entry || isa<SwitchInst>(U))
return false; // Use not in entry block.
+ }
return true;
}