| # RUN: llc -mtriple=amdgpu9.00-amd-amdhsa -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 pass: SILateBranchLoweringPass on early_term_in_loop |
| # CHECK-NEXT: Running analysis: MachineDominatorTreeAnalysis 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> |
| |
| --- |
| name: early_term_in_loop |
| tracksRegLiveness: true |
| body: | |
| bb.0: |
| successors: %bb.1 |
| $vgpr0 = V_MOV_B32_e32 0, implicit $exec |
| |
| ; Loop header contains SI_EARLY_TERMINATE_SCC0 followed by more instructions. |
| ; This triggers block splitting. Both bb.1 and bb.4 must remain in the loop. |
| bb.1: |
| liveins: $vgpr0 |
| successors: %bb.1, %bb.2 |
| S_CMP_LG_U32 0, 1, implicit-def $scc |
| SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec |
| $vgpr1 = V_MOV_B32_e32 1, implicit $exec |
| S_CBRANCH_SCC1 %bb.1, implicit $scc |
| |
| bb.2: |
| liveins: $vgpr0, $vgpr1 |
| EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec |
| S_ENDPGM 0 |
| ... |