• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx803 -run-pass=simple-register-coalescing -o - %s | FileCheck -check-prefix=GCN %s
2
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.
5
6# GCN: {{^body}}
7
8--- |
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"
11
12  define amdgpu_cs void @_amdgpu_cs_main(<3 x i32>) #0 {
13    ret void
14  }
15
16  attributes #0 = { nounwind "target-cpu"="gfx803" }
17...
18
19---
20name:            _amdgpu_cs_main
21tracksRegLiveness: true
22body:             |
23  bb.0:
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
31
32  bb.1:
33    successors: %bb.5(0x80000000)
34    undef %6.sub1:vreg_128 = COPY killed %5
35    %7:vreg_128 = COPY killed %6
36    S_BRANCH %bb.5
37
38  bb.2:
39    successors: %bb.3(0x40000000), %bb.4(0x40000000)
40    S_CBRANCH_SCC0 %bb.4, implicit undef $scc
41
42  bb.3:
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
51    S_BRANCH %bb.5
52
53  bb.4:
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
63
64  bb.5:
65    successors: %bb.8(0x40000000), %bb.6(0x40000000)
66    %15:vreg_128 = COPY killed %7
67    S_CBRANCH_SCC0 %bb.8, implicit undef $scc
68
69  bb.6:
70    successors: %bb.7(0x80000000)
71    %16:vreg_128 = COPY killed %15
72
73  bb.7:
74    successors: %bb.14(0x80000000)
75    %17:vreg_128 = COPY killed %16
76    S_BRANCH %bb.14
77
78  bb.8:
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
82    S_BRANCH %bb.9
83
84  bb.9:
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, 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
91
92  bb.10:
93    successors: %bb.12(0x80000000)
94    $exec = S_OR_B64 $exec, killed %22, implicit-def $scc
95    S_BRANCH %bb.12
96
97  bb.11:
98    successors: %bb.13(0x80000000)
99    %24:vreg_128 = COPY killed %15
100    %24.sub0:vreg_128 = COPY undef %18
101    S_BRANCH %bb.13
102
103  bb.12:
104    successors: %bb.11(0x80000000)
105    S_BRANCH %bb.11
106
107  bb.13:
108    successors: %bb.7(0x80000000)
109    %16:vreg_128 = COPY killed %24
110    S_BRANCH %bb.7
111
112  bb.14:
113    successors: %bb.15(0x80000000)
114    S_CBRANCH_SCC1 %bb.15, implicit undef $scc
115    S_BRANCH %bb.15
116
117  bb.15:
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
130    $m0 = S_MOV_B32 -1
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)
132    S_ENDPGM
133...
134