[PATCH] D26954: Remove unnecessary IDom check

Xin Tong via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 19:58:08 PST 2016


trentxintong created this revision.
trentxintong added reviewers: hfinkel, majnemer.
trentxintong added a subscriber: llvm-commits.
trentxintong set the repository for this revision to rL LLVM.

This Idom check seems unnecessary. The immediate children of a node on the Dominator Tree should always be the IDom of its immediate children.


Repository:
  rL LLVM

https://reviews.llvm.org/D26954

Files:
  Sink.cpp


Index: Sink.cpp
===================================================================
--- Sink.cpp
+++ Sink.cpp
@@ -169,8 +169,7 @@
   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))
+    if (IsAcceptableTarget(Inst, Candidate, DT, LI))
       SuccToSinkTo = Candidate;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26954.78822.patch
Type: text/x-patch
Size: 499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161122/b593236c/attachment.bin>


More information about the llvm-commits mailing list