annotate llvm/test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
anatofuz
parents:
diff changeset
2 ; RUN: llc -march=amdgcn -mcpu=tahiti -amdgpu-dce-in-ra=0 -o - %s | FileCheck %s
anatofuz
parents:
diff changeset
3 ; Don't crash when the use of an undefined value is only detected by the
anatofuz
parents:
diff changeset
4 ; register coalescer because it is hidden with subregister insert/extract.
anatofuz
parents:
diff changeset
5 target triple="amdgcn--"
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 define amdgpu_kernel void @foobar(float %a0, float %a1, float addrspace(1)* %out) nounwind {
anatofuz
parents:
diff changeset
8 ; CHECK-LABEL: foobar:
anatofuz
parents:
diff changeset
9 ; CHECK: ; %bb.0: ; %entry
anatofuz
parents:
diff changeset
10 ; CHECK-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
anatofuz
parents:
diff changeset
11 ; CHECK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
anatofuz
parents:
diff changeset
12 ; CHECK-NEXT: v_mbcnt_lo_u32_b32_e64 v0, -1, 0
anatofuz
parents:
diff changeset
13 ; CHECK-NEXT: v_cmp_eq_u32_e32 vcc, 0, v0
anatofuz
parents:
diff changeset
14 ; CHECK-NEXT: s_mov_b32 s2, -1
anatofuz
parents:
diff changeset
15 ; CHECK-NEXT: s_waitcnt lgkmcnt(0)
anatofuz
parents:
diff changeset
16 ; CHECK-NEXT: v_mov_b32_e32 v0, s4
anatofuz
parents:
diff changeset
17 ; CHECK-NEXT: v_mov_b32_e32 v1, s5
anatofuz
parents:
diff changeset
18 ; CHECK-NEXT: v_mov_b32_e32 v2, s6
anatofuz
parents:
diff changeset
19 ; CHECK-NEXT: v_mov_b32_e32 v3, s7
anatofuz
parents:
diff changeset
20 ; CHECK-NEXT: s_and_saveexec_b64 s[6:7], vcc
anatofuz
parents:
diff changeset
21 ; CHECK-NEXT: ; %bb.1: ; %ift
anatofuz
parents:
diff changeset
22 ; CHECK-NEXT: s_mov_b32 s4, s5
anatofuz
parents:
diff changeset
23 ; CHECK-NEXT: v_mov_b32_e32 v0, s4
anatofuz
parents:
diff changeset
24 ; CHECK-NEXT: v_mov_b32_e32 v1, s5
anatofuz
parents:
diff changeset
25 ; CHECK-NEXT: v_mov_b32_e32 v2, s6
anatofuz
parents:
diff changeset
26 ; CHECK-NEXT: v_mov_b32_e32 v3, s7
anatofuz
parents:
diff changeset
27 ; CHECK-NEXT: ; %bb.2: ; %ife
anatofuz
parents:
diff changeset
28 ; CHECK-NEXT: s_or_b64 exec, exec, s[6:7]
anatofuz
parents:
diff changeset
29 ; CHECK-NEXT: s_mov_b32 s3, 0xf000
anatofuz
parents:
diff changeset
30 ; CHECK-NEXT: buffer_store_dword v1, off, s[0:3], 0
anatofuz
parents:
diff changeset
31 ; CHECK-NEXT: s_endpgm
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 ; FIXME: The change related to the fact that
anatofuz
parents:
diff changeset
34 ; DetectDeadLanes pass hit "Copy across incompatible class" SGPR -> VGPR in analysis
anatofuz
parents:
diff changeset
35 ; and hence it cannot derive the fact that the vector element in the "ift" block is unused.
anatofuz
parents:
diff changeset
36 ; Such a copies appear because the float4 vectors and their elements in the test are uniform
anatofuz
parents:
diff changeset
37 ; but the PHI node in "ife" block is divergent because of the CF dependency (divergent branch in bb0)
anatofuz
parents:
diff changeset
38 entry:
anatofuz
parents:
diff changeset
39 %v0 = insertelement <4 x float> undef, float %a0, i32 0
anatofuz
parents:
diff changeset
40 %tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
anatofuz
parents:
diff changeset
41 %cnd = icmp eq i32 %tid, 0
anatofuz
parents:
diff changeset
42 br i1 %cnd, label %ift, label %ife
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 ift:
anatofuz
parents:
diff changeset
45 %v1 = insertelement <4 x float> undef, float %a1, i32 0
anatofuz
parents:
diff changeset
46 br label %ife
anatofuz
parents:
diff changeset
47
anatofuz
parents:
diff changeset
48 ife:
anatofuz
parents:
diff changeset
49 %val = phi <4 x float> [ %v1, %ift ], [ %v0, %entry ]
anatofuz
parents:
diff changeset
50 %v2 = extractelement <4 x float> %val, i32 1
anatofuz
parents:
diff changeset
51 store float %v2, float addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
52 ret void
anatofuz
parents:
diff changeset
53 }
anatofuz
parents:
diff changeset
54
anatofuz
parents:
diff changeset
55 declare i32 @llvm.amdgcn.mbcnt.lo(i32, i32) #0
anatofuz
parents:
diff changeset
56
anatofuz
parents:
diff changeset
57 attributes #0 = { nounwind readnone }