[llvm-commits] [llvm] r107980 - /llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
Gabor Greif
ggreif at gmail.com
Fri Jul 9 09:08:33 PDT 2010
Author: ggreif
Date: Fri Jul 9 11:08:33 2010
New Revision: 107980
URL: http://llvm.org/viewvc/llvm-project?rev=107980&view=rev
Log:
cache result of operator*
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp?rev=107980&r1=107979&r2=107980&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp Fri Jul 9 11:08:33 2010
@@ -46,9 +46,11 @@
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 @@
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;
}
More information about the llvm-commits
mailing list