[PATCH] D66190: [CodeGen] Add a pass to do block predication on SSA machine IR

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 17:12:28 PDT 2019


majnemer added inline comments.


================
Comment at: llvm/lib/CodeGen/EarlyIfConversion.cpp:472-473
 
   // This is a triangle or a diamond.
   // If Tail doesn't have any phis, there must be side effects.
+  if (!Predicate && (Tail->empty() || !Tail->front().isPHI())) {
----------------
Update this comment for the new logic.


================
Comment at: llvm/lib/CodeGen/EarlyIfConversion.cpp:987
+  MachineDomTreeNode *HeadNode = DomTree->getNode(IfConv.Head);
+  for (unsigned i = 0, e = Removed.size(); i != e; ++i) {
+    MachineDomTreeNode *Node = DomTree->getNode(Removed[i]);
----------------
Range based for loop?


================
Comment at: llvm/lib/CodeGen/EarlyIfConversion.cpp:1004-1005
+  // edges, so updating LoopInfo is simply removing the dead blocks.
+  for (unsigned i = 0, e = Removed.size(); i != e; ++i)
+    Loops->removeBlock(Removed[i]);
+}
----------------
Ditto.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66190/new/

https://reviews.llvm.org/D66190





More information about the llvm-commits mailing list