mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-05 19:29:01 +00:00
Remove unnecessary IDom check
Summary: This Idom check seems unnecessary. The immediate children of a node on the Dominator Tree should always be the IDom of its immediate children in this case. Reviewers: hfinkel, majnemer, dberlin Reviewed By: dberlin Subscribers: dberlin, davide, llvm-commits Differential Revision: https://reviews.llvm.org/D26954 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298232 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9534108197
commit
f030d6b014
@ -164,13 +164,14 @@ static bool SinkInstruction(Instruction *Inst,
|
||||
|
||||
// Instructions can only be sunk if all their uses are in blocks
|
||||
// dominated by one of the successors.
|
||||
// Look at all the postdominators and see if we can sink it in one.
|
||||
// Look at all the dominated blocks and see if we can sink it in one.
|
||||
DomTreeNode *DTN = DT.getNode(Inst->getParent());
|
||||
for (DomTreeNode::iterator I = DTN->begin(), E = DTN->end();
|
||||
I != E && SuccToSinkTo == nullptr; ++I) {
|
||||
BasicBlock *Candidate = (*I)->getBlock();
|
||||
if ((*I)->getIDom()->getBlock() == Inst->getParent() &&
|
||||
IsAcceptableTarget(Inst, Candidate, DT, LI))
|
||||
// A node always immediate-dominates its children on the dominator
|
||||
// tree.
|
||||
if (IsAcceptableTarget(Inst, Candidate, DT, LI))
|
||||
SuccToSinkTo = Candidate;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user