xref: /aosp_15_r20/external/llvm/test/CodeGen/AMDGPU/cayman-loop-bug.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=r600 -mcpu=cayman | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: {{^}}main:
4*9880d681SAndroid Build Coastguard Worker; CHECK: LOOP_START_DX10
5*9880d681SAndroid Build Coastguard Worker; CHECK: ALU_PUSH_BEFORE
6*9880d681SAndroid Build Coastguard Worker; CHECK: LOOP_START_DX10
7*9880d681SAndroid Build Coastguard Worker; CHECK: PUSH
8*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: ALU_PUSH_BEFORE
9*9880d681SAndroid Build Coastguard Worker; CHECK: END_LOOP
10*9880d681SAndroid Build Coastguard Worker; CHECK: END_LOOP
11*9880d681SAndroid Build Coastguard Workerdefine amdgpu_ps void @main (<4 x float> inreg %reg0) {
12*9880d681SAndroid Build Coastguard Workerentry:
13*9880d681SAndroid Build Coastguard Worker  br label %outer_loop
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workerouter_loop:
16*9880d681SAndroid Build Coastguard Worker  %cnt = phi i32 [0, %entry], [%cnt_incr, %inner_loop]
17*9880d681SAndroid Build Coastguard Worker  %cond = icmp eq i32 %cnt, 16
18*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %outer_loop_body, label %exit
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Workerouter_loop_body:
21*9880d681SAndroid Build Coastguard Worker  %cnt_incr = add i32 %cnt, 1
22*9880d681SAndroid Build Coastguard Worker  br label %inner_loop
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Workerinner_loop:
25*9880d681SAndroid Build Coastguard Worker  %cnt2 = phi i32 [0, %outer_loop_body], [%cnt2_incr, %inner_loop_body]
26*9880d681SAndroid Build Coastguard Worker  %n = load volatile i32, i32 addrspace(1)* undef
27*9880d681SAndroid Build Coastguard Worker  %cond2 = icmp slt i32 %cnt2, %n
28*9880d681SAndroid Build Coastguard Worker  br i1 %cond2, label %inner_loop_body, label %outer_loop
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Workerinner_loop_body:
31*9880d681SAndroid Build Coastguard Worker  %cnt2_incr = add i32 %cnt2, 1
32*9880d681SAndroid Build Coastguard Worker  br label %inner_loop
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Workerexit:
35*9880d681SAndroid Build Coastguard Worker  ret void
36*9880d681SAndroid Build Coastguard Worker}
37