[PATCH] D134557: [BranchRelaxation] Fall through only if block has no unconditional branches

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 08:48:36 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/BranchRelaxation.cpp:508-510
+    } else if (FailToAnalyze && (!PrevBB->back().isBarrier() ||
+                                 TII->isPredicated(PrevBB->back()))) {
+      InsertUncondBranch(PrevBB, DestBB);
----------------
Is this case covered in the test?


================
Comment at: llvm/test/CodeGen/AMDGPU/branch-relax-no-terminators.mir:3-6
+# CHECK-LABEL: branch_no_terminators
+# CHECK-LABEL: bb.0.entry:
+# CHECK:  S_WAITCNT 0
+# CHECK:  $sgpr4_sgpr5 = S_OR_SAVEEXEC_B64 -1, implicit-def $exec, implicit-def dead $scc, implicit $exec
----------------
Should use update_mir_test_checks at this point


================
Comment at: llvm/test/CodeGen/AMDGPU/branch-relax-no-terminators.mir:864
+  !0 = !{}
+
+...
----------------
You should be able to drop the IR section


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134557



More information about the llvm-commits mailing list