1 # RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx803 -run-pass=simple-register-coalescing -o - %s | FileCheck -check-prefix=GCN %s
3 # With one version of the D48102 fix, this test failed with
4 # Assertion failed: (ValNo && "CopyMI input register not live"), function reMaterializeTrivialDef, file ../lib/CodeGen/RegisterCoalescer.cpp, line 1107.
9 target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
10 target triple = "amdgcn--amdpal"
12 define amdgpu_cs void @_amdgpu_cs_main(<3 x i32>) #0 {
16 attributes #0 = { nounwind "target-cpu"="gfx803" }
21 tracksRegLiveness: true
24 successors: %bb.1(0x40000000), %bb.2(0x40000000)
25 %0:vgpr_32 = V_MUL_F32_e32 0, undef %1:vgpr_32, implicit $exec
26 %2:vgpr_32 = V_CVT_U32_F32_e32 killed %0, implicit $exec
27 %3:vgpr_32 = V_CVT_F32_I32_e32 killed %2, implicit $exec
28 %4:vgpr_32 = V_CVT_U32_F32_e32 killed %3, implicit $exec
29 %5:vgpr_32 = V_LSHRREV_B32_e32 4, killed %4, implicit $exec
30 S_CBRANCH_SCC0 %bb.2, implicit undef $scc
33 successors: %bb.5(0x80000000)
34 undef %6.sub1:vreg_128 = COPY killed %5
35 %7:vreg_128 = COPY killed %6
39 successors: %bb.3(0x40000000), %bb.4(0x40000000)
40 S_CBRANCH_SCC0 %bb.4, implicit undef $scc
43 successors: %bb.5(0x80000000)
44 %8:sreg_32_xm0 = S_MOV_B32 0
45 undef %9.sub0:sreg_128 = COPY %8
46 %9.sub1:sreg_128 = COPY %8
47 %9.sub2:sreg_128 = COPY %8
48 %9.sub3:sreg_128 = COPY killed %8
49 %10:vreg_128 = COPY killed %9
50 %7:vreg_128 = COPY killed %10
54 successors: %bb.5(0x80000000)
55 %11:sreg_32_xm0 = S_MOV_B32 0
56 undef %12.sub0:sreg_128 = COPY %11
57 %12.sub1:sreg_128 = COPY %11
58 %12.sub2:sreg_128 = COPY %11
59 %12.sub3:sreg_128 = COPY killed %11
60 %13:sreg_128 = COPY killed %12
61 %14:vreg_128 = COPY killed %13
62 %7:vreg_128 = COPY killed %14
65 successors: %bb.8(0x40000000), %bb.6(0x40000000)
66 %15:vreg_128 = COPY killed %7
67 S_CBRANCH_SCC0 %bb.8, implicit undef $scc
70 successors: %bb.7(0x80000000)
71 %16:vreg_128 = COPY killed %15
74 successors: %bb.14(0x80000000)
75 %17:vreg_128 = COPY killed %16
79 successors: %bb.9(0x40000000), %bb.11(0x40000000)
80 %18:vgpr_32 = V_MUL_LO_I32 %15.sub1, target-flags(amdgpu-gotprel32-lo) 7, implicit $exec
81 S_CBRANCH_SCC1 %bb.11, implicit undef $scc
85 successors: %bb.10(0x80000000)
86 %19:vreg_128 = BUFFER_LOAD_FORMAT_XYZW_IDXEN killed %18, undef %20:sreg_128, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 16 from constant-pool, align 1, addrspace 4)
87 %21:sreg_64 = V_CMP_NE_U32_e64 target-flags(amdgpu-gotprel) 0, killed %19.sub0, implicit $exec
88 %22:sreg_64 = COPY $exec, implicit-def $exec
89 %23:sreg_64 = S_AND_B64 %22, %21, implicit-def dead $scc
90 $exec = S_MOV_B64_term killed %23
93 successors: %bb.12(0x80000000)
94 $exec = S_OR_B64 $exec, killed %22, implicit-def $scc
98 successors: %bb.13(0x80000000)
99 %24:vreg_128 = COPY killed %15
100 %24.sub0:vreg_128 = COPY undef %18
104 successors: %bb.11(0x80000000)
108 successors: %bb.7(0x80000000)
109 %16:vreg_128 = COPY killed %24
113 successors: %bb.15(0x80000000)
114 S_CBRANCH_SCC1 %bb.15, implicit undef $scc
118 undef %25.sub2:vreg_128 = COPY killed %17.sub2
119 %26:sreg_32_xm0 = S_MOV_B32 0
120 undef %27.sub0:sreg_256 = COPY %26
121 %27.sub1:sreg_256 = COPY %26
122 %27.sub2:sreg_256 = COPY %26
123 %27.sub3:sreg_256 = COPY %26
124 %27.sub4:sreg_256 = COPY %26
125 %27.sub5:sreg_256 = COPY %26
126 %27.sub6:sreg_256 = COPY %26
127 %27.sub7:sreg_256 = COPY killed %26
128 %28:vgpr_32 = IMAGE_LOAD_V1_V4 killed %25, killed %27, 2, -1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 16 from constant-pool, addrspace 4)
129 %29:vgpr_32 = V_ADD_F32_e32 0, killed %28, implicit $exec
131 DS_WRITE_B32 undef %30:vgpr_32, killed %29, 0, 0, implicit $m0, implicit $exec :: (store 4 into `i32 addrspace(3)* undef`, addrspace 3)