mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-04 07:32:13 +00:00
performance: cache the dereferenced use_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101253 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
de4c0a7da7
commit
67894a3d02
@ -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…
x
Reference in New Issue
Block a user