[PATCH] D26954: Remove unnecessary IDom check
Xin Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 19 17:42:42 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL298232: Remove unnecessary IDom check (authored by trentxintong).
Changed prior to commit:
https://reviews.llvm.org/D26954?vs=92299&id=92300#toc
Repository:
rL LLVM
https://reviews.llvm.org/D26954
Files:
llvm/trunk/lib/Transforms/Scalar/Sink.cpp
Index: llvm/trunk/lib/Transforms/Scalar/Sink.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/Sink.cpp
+++ llvm/trunk/lib/Transforms/Scalar/Sink.cpp
@@ -164,13 +164,14 @@
// 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;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26954.92300.patch
Type: text/x-patch
Size: 995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170320/07d9ea1b/attachment.bin>
More information about the llvm-commits
mailing list