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: (Id != S.end() && T != S.end() && T->valno == Id->valno), function pruneSubRegValues, file ../lib/CodeGen/RegisterCoalescer.cpp, line 2870.
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 ; Function Attrs: nounwind
13 define amdgpu_cs void @_amdgpu_cs_main(<3 x i32> %arg) #0 {
17 attributes #0 = { nounwind "target-cpu"="gfx803" }
22 tracksRegLiveness: true
24 - { reg: '$vgpr0', virtual-reg: '%0' }
27 successors: %bb.1(0x40000000), %bb.21(0x40000000)
28 liveins: $vgpr0, $vgpr1, $vgpr2
29 %0:vgpr_32 = COPY killed $vgpr0
30 S_CBRANCH_SCC1 %bb.21, implicit undef $scc
33 successors: %bb.2(0x40000000), %bb.17(0x40000000)
34 S_CBRANCH_SCC1 %bb.17, implicit undef $scc
37 successors: %bb.4(0x40000000), %bb.3(0x40000000)
38 %1:sreg_32_xm0 = S_MOV_B32 0
39 %2:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
40 undef %3.sub0:vreg_128 = COPY killed %0
41 %3.sub2:vreg_128 = COPY killed %2
42 undef %4.sub0:sreg_256 = COPY %1
43 %4.sub1:sreg_256 = COPY %1
44 %4.sub2:sreg_256 = COPY %1
45 %4.sub3:sreg_256 = COPY %1
46 %4.sub4:sreg_256 = COPY %1
47 %4.sub5:sreg_256 = COPY %1
48 %4.sub6:sreg_256 = COPY %1
49 %4.sub7:sreg_256 = COPY killed %1
50 %5:vgpr_32 = IMAGE_LOAD_V1_V4 killed %3, killed %4, 1, -1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 16 from constant-pool, addrspace 4)
51 %6:vgpr_32 = V_MAD_F32 0, killed %5, 0, 0, 0, 0, 0, 0, implicit $exec
52 %7:vgpr_32 = V_RCP_F32_e32 killed %6, implicit $exec
53 %8:vgpr_32 = V_MUL_F32_e32 0, killed %7, implicit $exec
54 %9:vgpr_32 = V_MAD_F32 0, killed %8, 0, 0, 0, 0, 0, 0, implicit $exec
55 dead %10:vgpr_32 = V_MAC_F32_e32 undef %11:vgpr_32, undef %12:vgpr_32, undef %10, implicit $exec
56 undef %13.sub0:vreg_128 = COPY %9
57 %14:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec
58 S_CBRANCH_SCC0 %bb.4, implicit undef $scc
61 successors: %bb.6(0x80000000)
62 %15:vreg_128 = IMPLICIT_DEF
63 %16:vgpr_32 = COPY killed %14
67 successors: %bb.5(0x40000000), %bb.7(0x40000000)
68 %17:vgpr_32 = V_MAD_F32 0, killed %9, 0, 0, 0, 0, 0, 0, implicit $exec
69 %18:vgpr_32 = V_MIN_F32_e32 1065353216, killed %17, implicit $exec
70 %19:sreg_64_xexec = V_CMP_NEQ_F32_e64 0, 1065353216, 0, killed %18, 0, implicit $exec
71 %20:vgpr_32 = V_MOV_B32_e32 2143289344, implicit $exec
72 %21:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, killed %20, killed %19, implicit $exec
73 %22:sreg_64 = V_CMP_LT_F32_e64 0, 0, 0, killed %21, 0, implicit $exec
74 %23:sreg_64 = COPY $exec, implicit-def $exec
75 %24:sreg_64 = S_AND_B64 %23, %22, implicit-def dead $scc
76 $exec = S_MOV_B64_term killed %24
77 SI_MASK_BRANCH %bb.7, implicit $exec
81 successors: %bb.7(0x80000000)
85 successors: %bb.8(0x40000000), %bb.10(0x40000000)
86 %25:vgpr_32 = COPY killed %16
87 %26:vreg_128 = COPY killed %15
88 %27:sreg_64 = V_CMP_NE_U32_e64 0, killed %25, implicit $exec
89 %28:sreg_64 = S_AND_B64 $exec, killed %27, implicit-def dead $scc
90 $vcc = COPY killed %28
91 %29:vreg_128 = COPY killed %26
92 S_CBRANCH_VCCNZ %bb.8, implicit killed $vcc
96 successors: %bb.6(0x80000000)
97 $exec = S_OR_B64 $exec, killed %23, implicit-def $scc
98 %30:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
99 %15:vreg_128 = COPY %13
100 %16:vgpr_32 = COPY killed %30
104 successors: %bb.9(0x40000000), %bb.11(0x40000000)
105 %31:vreg_128 = COPY killed %13
106 S_CBRANCH_SCC1 %bb.11, implicit undef $scc
110 successors: %bb.11(0x80000000)
111 %32:sreg_32_xm0 = S_MOV_B32 0
112 undef %33.sub0:sgpr_128 = COPY %32
113 %33.sub1:sgpr_128 = COPY %32
114 %33.sub2:sgpr_128 = COPY %32
115 %33.sub3:sgpr_128 = COPY killed %32
116 %34:sgpr_128 = COPY killed %33
117 %35:vreg_128 = COPY killed %34
118 %31:vreg_128 = COPY killed %35
122 successors: %bb.14(0x80000000)
123 %36:vreg_128 = COPY killed %29
127 successors: %bb.13(0x40000000), %bb.12(0x40000000)
128 %37:vreg_128 = COPY killed %31
129 S_CBRANCH_SCC0 %bb.13, implicit undef $scc
132 successors: %bb.10(0x80000000)
133 %29:vreg_128 = COPY killed %37
137 successors: %bb.10(0x80000000)
138 %29:vreg_128 = COPY killed %37
142 successors: %bb.15(0x40000000), %bb.16(0x40000000)
143 %38:vgpr_32 = V_MAD_F32 0, killed %36.sub0, 0, target-flags(amdgpu-gotprel) 0, 0, 0, 0, 0, implicit $exec
144 %39:vgpr_32 = V_MAD_F32 0, killed %38, 0, 0, 0, 0, 0, 0, implicit $exec
145 %40:vgpr_32 = V_MAD_F32 0, killed %39, 0, -1090519040, 0, 1056964608, 0, 0, implicit $exec
146 %41:vgpr_32 = V_MAD_F32 0, killed %40, 0, 0, 0, -1090519040, 0, 0, implicit $exec
147 %42:vgpr_32 = V_CVT_I32_F32_e32 killed %41, implicit $exec
148 %43:sreg_32_xm0_xexec = S_BUFFER_LOAD_DWORD_IMM undef %44:sgpr_128, 12, 0, 0 :: (dereferenceable invariant load 4)
149 %45:vgpr_32 = V_MUL_LO_I32 killed %42, killed %43, implicit $exec
150 %46:vgpr_32 = V_LSHLREV_B32_e32 2, killed %45, implicit $exec
151 %47:vgpr_32 = BUFFER_LOAD_FORMAT_X_IDXEN killed %46, undef %48:sgpr_128, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4 from constant-pool, align 1, addrspace 4)
152 %49:sreg_64 = V_CMP_NE_U32_e64 0, killed %47, implicit $exec
153 %50:sreg_64 = COPY $exec, implicit-def $exec
154 %51:sreg_64 = S_AND_B64 %50, %49, implicit-def dead $scc
155 $exec = S_MOV_B64_term killed %51
156 SI_MASK_BRANCH %bb.16, implicit $exec
160 successors: %bb.16(0x80000000)
163 successors: %bb.17(0x80000000)
164 $exec = S_OR_B64 $exec, killed %50, implicit-def $scc
168 successors: %bb.21(0x40000000), %bb.18(0x40000000)
169 S_CBRANCH_SCC1 %bb.21, implicit undef $scc
172 successors: %bb.19(0x40000000), %bb.20(0x40000000)
173 S_CBRANCH_SCC1 %bb.19, implicit undef $scc
177 successors: %bb.20(0x80000000)
180 successors: %bb.21(0x80000000)