annotate test/CodeGen/AMDGPU/splitkit.mir @ 128:c347d3398279 default tip

fix
author mir3636
date Wed, 06 Dec 2017 14:37:17 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 # RUN: llc -o - %s -mtriple=amdgcn-- -mcpu=fiji -verify-machineinstrs -run-pass=greedy,virtregrewriter | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 --- |
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 define amdgpu_kernel void @func0() #0 { ret void }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 define amdgpu_kernel void @func1() #0 { ret void }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 define amdgpu_kernel void @splitHoist() #0 { ret void }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 attributes #0 = { "amdgpu-num-sgpr"="12" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 ...
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 # Make sure we only get a single spill+reload even if liverange splitting
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 # created a sequence of multiple copy instructions.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 # CHECK-LABEL: name: func0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 # CHECK: SI_SPILL_S128_SAVE
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 # CHECK-NOT: SI_SPILL_S128_SAVE
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 # CHECK: S_NOP 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 # CHECK: SI_SPILL_S128_RESTORE
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 # CHECK-NOT: SI_SPILL_S128_RESTORE
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 name: func0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 body: |
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 bb.0:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 S_NOP 0, implicit-def undef %0.sub0 : sreg_128
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 S_NOP 0, implicit-def %0.sub3 : sreg_128
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 ; Clobber registers
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 S_NOP 0, implicit-def dead %sgpr0, implicit-def dead %sgpr1, implicit-def dead %sgpr2, implicit-def dead %sgpr3, implicit-def dead %sgpr4, implicit-def dead %sgpr5, implicit-def dead %sgpr6, implicit-def dead %sgpr7, implicit-def dead %sgpr8, implicit-def dead %sgpr9, implicit-def dead %sgpr10, implicit-def dead %sgpr11
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 S_NOP 0, implicit %0.sub0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 S_NOP 0, implicit %0.sub3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 S_NOP 0, implicit %0.sub0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 S_NOP 0, implicit %0.sub3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 ...
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 # LiveRange splitting should split this into 2 intervals with the second getting
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 # allocated to sgpr0_sgpr1 and the first to something else so we see two copies
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 # in between for the two subregisters that are alive.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 # CHECK-LABEL: name: func1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 # CHECK: [[REG0:%sgpr[0-9]+]] = COPY %sgpr0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 # CHECK: [[REG1:%sgpr[0-9]+]] = COPY %sgpr2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 # CHECK: S_NOP 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 # CHECK: S_NOP 0, implicit [[REG0]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 # CHECK: S_NOP 0, implicit [[REG1]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 # CHECK: %sgpr0 = COPY [[REG0]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 # CHECK: %sgpr2 = COPY [[REG1]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 # CHECK: S_NOP
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 # CHECK: S_NOP 0, implicit %sgpr0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 # CHECK: S_NOP 0, implicit %sgpr2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 name: func1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 tracksRegLiveness: true
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 body: |
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 bb.0:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 liveins: %sgpr0, %sgpr1, %sgpr2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 undef %0.sub0 : sreg_128 = COPY %sgpr0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 %0.sub2 = COPY %sgpr2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 S_NOP 0, implicit-def dead %sgpr0, implicit-def dead %sgpr1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 S_NOP 0, implicit %0.sub0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 S_NOP 0, implicit %0.sub2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 ; Clobber everything but sgpr0-sgpr3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 S_NOP 0, implicit-def dead %sgpr4, implicit-def dead %sgpr5, implicit-def dead %sgpr6, implicit-def dead %sgpr7, implicit-def dead %sgpr8, implicit-def dead %sgpr9, implicit-def dead %sgpr10, implicit-def dead %sgpr11, implicit-def dead %sgpr12, implicit-def dead %sgpr13, implicit-def dead %sgpr14, implicit-def dead %sgpr15, implicit-def dead %vcc_lo, implicit-def dead %vcc_hi
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 S_NOP 0, implicit %0.sub0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 S_NOP 0, implicit %0.sub2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 ...
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 # Check that copy hoisting out of loops works. This mainly should not crash the
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 # compiler when it hoists a subreg copy sequence.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 # CHECK-LABEL: name: splitHoist
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 # CHECK: S_NOP 0, implicit-def %sgpr0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 # CHECK: S_NOP 0, implicit-def %sgpr3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 # CHECK-NEXT: SI_SPILL_S128_SAVE
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 name: splitHoist
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 tracksRegLiveness: true
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 body: |
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 bb.0:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 successors: %bb.1, %bb.2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 S_NOP 0, implicit-def undef %0.sub0 : sreg_128
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 S_NOP 0, implicit-def %0.sub3 : sreg_128
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 S_CBRANCH_VCCNZ %bb.1, implicit undef %vcc
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 S_BRANCH %bb.2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 bb.1:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 successors: %bb.1, %bb.3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 S_NOP 0, implicit %0.sub0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 ; Clobber registers
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 S_NOP 0, implicit-def dead %sgpr0, implicit-def dead %sgpr1, implicit-def dead %sgpr2, implicit-def dead %sgpr3, implicit-def dead %sgpr4, implicit-def dead %sgpr5, implicit-def dead %sgpr6, implicit-def dead %sgpr7, implicit-def dead %sgpr8, implicit-def dead %sgpr9, implicit-def dead %sgpr10, implicit-def dead %sgpr11
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 S_CBRANCH_VCCNZ %bb.1, implicit undef %vcc
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 S_BRANCH %bb.3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94 bb.2:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 successors: %bb.3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96 ; Clobber registers
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97 S_NOP 0, implicit-def dead %sgpr0, implicit-def dead %sgpr1, implicit-def dead %sgpr2, implicit-def dead %sgpr3, implicit-def dead %sgpr4, implicit-def dead %sgpr5, implicit-def dead %sgpr6, implicit-def dead %sgpr7, implicit-def dead %sgpr8, implicit-def dead %sgpr9, implicit-def dead %sgpr10, implicit-def dead %sgpr11
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 S_BRANCH %bb.3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 bb.3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 S_NOP 0, implicit %0.sub0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 S_NOP 0, implicit %0.sub3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 S_NOP 0, implicit %0.sub0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 S_NOP 0, implicit %0.sub3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105 ...