mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
performance: cache the dereferenced use_iterator
llvm-svn: 101253
This commit is contained in:
parent
6471bcb1fd
commit
d482337c1a
@ -46,10 +46,11 @@ namespace {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user