hazard.mir
3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GCN -check-prefix=VI %s
# RUN: llc -march=amdgcn -mcpu=gfx803 -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GCN -check-prefix=GFX8 %s
# RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GCN -check-prefix=GFX9 %s
# GCN-LABEL: name: hazard_implicit_def
# GCN: bb.0.entry:
# GCN: $m0 = S_MOV_B32
# GFX9: S_NOP 0
# VI-NOT: S_NOP_0
# GCN: V_INTERP_P1_F32
---
name: hazard_implicit_def
alignment: 1
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
registers:
liveins:
- { reg: '$sgpr7', virtual-reg: '' }
- { reg: '$vgpr4', virtual-reg: '' }
body: |
bb.0.entry:
liveins: $sgpr7, $vgpr4
$m0 = S_MOV_B32 killed $sgpr7
$vgpr5 = IMPLICIT_DEF
$vgpr0 = V_INTERP_P1_F32 killed $vgpr4, 0, 0, implicit $mode, implicit $m0, implicit $exec
SI_RETURN_TO_EPILOG killed $vgpr5, killed $vgpr0
...
# GCN-LABEL: name: hazard_inlineasm
# GCN: bb.0.entry:
# GCN: $m0 = S_MOV_B32
# GFX9: S_NOP 0
# VI-NOT: S_NOP_0
# GCN: V_INTERP_P1_F32
---
name: hazard_inlineasm
alignment: 1
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
registers:
liveins:
- { reg: '$sgpr7', virtual-reg: '' }
- { reg: '$vgpr4', virtual-reg: '' }
body: |
bb.0.entry:
liveins: $sgpr7, $vgpr4
$m0 = S_MOV_B32 killed $sgpr7
INLINEASM &"; no-op", 1, 327690, def $vgpr5
$vgpr0 = V_INTERP_P1_F32 killed $vgpr4, 0, 0, implicit $mode, implicit $m0, implicit $exec
SI_RETURN_TO_EPILOG killed $vgpr5, killed $vgpr0
...
# IMPLICIT_DEF/DBG_VALUE instructions should not prevent the hazard recognizer
# from adding s_nop instructions between m0 update and s_sendmsg.
# GCN-LABEL: name: hazard-lookahead-implicit-def
# GCN: $vgpr6 = IMPLICIT_DEF
# GFX8-NEXT: S_NOP 0
# GFX9-NEXT: S_NOP 0
# GCN: S_SENDMSG 3, implicit $exec, implicit $m0
---
name: hazard-lookahead-implicit-def
body: |
bb.0:
$m0 = S_MOV_B32 killed $sgpr12
$vgpr0 = IMPLICIT_DEF
$vgpr1 = IMPLICIT_DEF
$vgpr2 = IMPLICIT_DEF
$vgpr3 = IMPLICIT_DEF
$vgpr4 = IMPLICIT_DEF
$vgpr5 = IMPLICIT_DEF
$vgpr6 = IMPLICIT_DEF
S_SENDMSG 3, implicit $exec, implicit $m0
S_ENDPGM 0
...
# GCN-LABEL: name: hazard-lookahead-dbg-value
# GCN: DBG_VALUE 6
# GFX8-NEXT: S_NOP 0
# GFX9-NEXT: S_NOP 0
# GCN: S_SENDMSG 3, implicit $exec, implicit $m0
---
name: hazard-lookahead-dbg-value
body: |
bb.0:
$m0 = S_MOV_B32 killed $sgpr12
DBG_VALUE 0
DBG_VALUE 1
DBG_VALUE 2
DBG_VALUE 3
DBG_VALUE 4
DBG_VALUE 5
DBG_VALUE 6
S_SENDMSG 3, implicit $exec, implicit $m0
S_ENDPGM 0
...
# GCN-LABEL: name: hazard-lookahead-dbg-label
# GCN: DBG_LABEL 6
# GFX8-NEXT: S_NOP 0
# GFX9-NEXT: S_NOP 0
# GCN: S_SENDMSG 3, implicit $exec, implicit $m0
---
name: hazard-lookahead-dbg-label
body: |
bb.0:
$m0 = S_MOV_B32 killed $sgpr12
DBG_LABEL 0
DBG_LABEL 1
DBG_LABEL 2
DBG_LABEL 3
DBG_LABEL 4
DBG_LABEL 5
DBG_LABEL 6
S_SENDMSG 3, implicit $exec, implicit $m0
S_ENDPGM 0
...