mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
There's no need to consider PHI nodes in the same block as the instruction
we're inserting sigma/phi functions for. Patch by Andre Tavares. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75138 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -282,12 +282,16 @@ void SSI::substituteUse(Instruction *I) {
|
||||
}
|
||||
|
||||
/// Test if the BasicBlock BB dominates any use or definition of value.
|
||||
/// If it dominates a phi instruction that is on the same BasicBlock,
|
||||
/// that does not count.
|
||||
///
|
||||
bool SSI::dominateAny(BasicBlock *BB, Instruction *value) {
|
||||
for (Value::use_iterator begin = value->use_begin(),
|
||||
end = value->use_end(); begin != end; ++begin) {
|
||||
Instruction *I = cast<Instruction>(*begin);
|
||||
BasicBlock *BB_father = I->getParent();
|
||||
if (BB == BB_father && isa<PHINode>(I))
|
||||
continue;
|
||||
if (DT_->dominates(BB, BB_father)) {
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user