[llvm] [AMDGPU] Teach SILateBranchLowering pass to preserve MachineLoopInfo (PR #178276)

Dark Steve via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 29 06:15:32 PST 2026


================
@@ -0,0 +1,42 @@
+# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -passes="require<machine-loops>,si-late-branch-lowering,print<machine-loops>" -debug-pass-manager -filetype=null %s 2>&1 | FileCheck %s
+
+# Test that MachineLoopInfo is preserved when splitting a block inside a loop
+# due to early termination handling.
+
+# CHECK: Running analysis: MachineLoopAnalysis on early_term_in_loop
+# CHECK-NEXT: Running analysis: MachineDominatorTreeAnalysis on early_term_in_loop
+# CHECK-NEXT: Running pass: SILateBranchLoweringPass on early_term_in_loop
+# CHECK-NEXT: Running pass: MachineLoopPrinterPass on early_term_in_loop
+# CHECK-NEXT: Machine loop info for machine function 'early_term_in_loop':
+# CHECK-NOT: Running analysis: MachineLoopAnalysis on early_term_in_loop
+# CHECK-NEXT: Loop at depth 1 containing: %bb.1<header><exiting>,%bb.4<latch><exiting>
+
+--- |
----------------
PrasoonMishra wrote:

Done.

https://github.com/llvm/llvm-project/pull/178276


More information about the llvm-commits mailing list