[llvm-commits] [llvm] r101253 - /llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp
Gabor Greif
ggreif at gmail.com
Wed Apr 14 09:48:56 PDT 2010
Author: ggreif
Date: Wed Apr 14 11:48:56 2010
New Revision: 101253
URL: http://llvm.org/viewvc/llvm-project?rev=101253&view=rev
Log:
performance: cache the dereferenced use_iterator
Modified:
llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp?rev=101253&r1=101252&r2=101253&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp Wed Apr 14 11:48:56 2010
@@ -46,10 +46,11 @@
bool valueEscapes(const Instruction *Inst) const {
const BasicBlock *BB = Inst->getParent();
for (Value::const_use_iterator UI = Inst->use_begin(),E = Inst->use_end();
- UI != E; ++UI)
- if (cast<Instruction>(*UI)->getParent() != BB ||
- isa<PHINode>(*UI))
+ UI != E; ++UI) {
+ const Instruction *I = cast<Instruction>(*UI);
+ if (I->getParent() != BB || isa<PHINode>(I))
return true;
+ }
return false;
}
More information about the llvm-commits
mailing list