[PATCH] D91435: [AMDGPU] Split edge to make si_if dominate end_cf

Alexander via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 08:41:05 PST 2020


alex-t marked an inline comment as done.
alex-t added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp:319-322
+    if (!DT->dominates(DefBB, BB)) {
+      // Split edge to make Def dominate Use
+      FirstInsertionPt = &*SplitEdge(DefBB, BB, DT, LI)->getFirstInsertionPt();
+    }
----------------
arsenm wrote:
> Is this the same as unconditionally calling SplitCriticalEdge?
Not really.  Any edge from the block with multiple successors to block with multiple predecessors considered critical. So, changing to unconditional call to SplitCriticalEdge involves a lot of trivial CFG patterns that do not require splitting.

For example:

        "entry"     <--  entry has 2 successors
         /        \
    "if.then"   |  <-- this edge is considered as critical
        \         /
          "end"    <-- end has 2 predecessors

At least the isCriticalEdge function in CFG.cpp : line 101 works this way


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91435



More information about the llvm-commits mailing list