1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -run-pass=early-tailduplication -verify-machineinstrs -o - %s | FileCheck %s
4 # Early tail duplication should not merge bb.6 into bb.5, adding a
5 # non-terminator (S_SLEEP) after the terminator S_MOV_B32_term.
8 name: tail_duplicate_terminator
9 tracksRegLiveness: true
11 ; CHECK-LABEL: name: tail_duplicate_terminator
13 ; CHECK-NEXT: successors: %bb.2(0x80000000)
15 ; CHECK-NEXT: S_BRANCH %bb.2
18 ; CHECK-NEXT: successors: %bb.2(0x80000000)
20 ; CHECK-NEXT: S_SLEEP 1
23 ; CHECK-NEXT: successors: %bb.3(0x80000000)
25 ; CHECK-NEXT: [[S_MOV_B32_term:%[0-9]+]]:sreg_32_xm0_xexec = S_MOV_B32_term $exec_lo
28 ; CHECK-NEXT: successors: %bb.3(0x40000000), %bb.4(0x40000000)
30 ; CHECK-NEXT: SI_WATERFALL_LOOP %bb.3, implicit $exec
33 ; CHECK-NEXT: successors: %bb.5(0x80000000)
35 ; CHECK-NEXT: $exec_lo = S_MOV_B32_term [[S_MOV_B32_term]]
38 ; CHECK-NEXT: successors: %bb.1(0x80000000)
40 ; CHECK-NEXT: S_SLEEP 2
41 ; CHECK-NEXT: S_BRANCH %bb.1
49 %0:sreg_32_xm0_xexec = S_MOV_B32_term $exec_lo
52 SI_WATERFALL_LOOP %bb.4, implicit $exec
55 $exec_lo = S_MOV_B32_term %0