1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GFX9 %s
3 # RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=VI %s
4 # RUN: llc -march=amdgcn -mcpu=hawaii -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=CI %s
5 # RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=SI %s
6 # RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GFX10 %s
7 # RUN: llc -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GFX10 %s
11 tracksRegLiveness: true
16 ; GFX9-LABEL: name: m0_gws_init0
17 ; GFX9: liveins: $vgpr0
19 ; GFX9-NEXT: $m0 = S_MOV_B32 -1
21 ; GFX9-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
22 ; VI-LABEL: name: m0_gws_init0
25 ; VI-NEXT: $m0 = S_MOV_B32 -1
27 ; VI-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
28 ; CI-LABEL: name: m0_gws_init0
31 ; CI-NEXT: $m0 = S_MOV_B32 -1
32 ; CI-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
33 ; SI-LABEL: name: m0_gws_init0
36 ; SI-NEXT: $m0 = S_MOV_B32 -1
37 ; SI-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
38 ; GFX10-LABEL: name: m0_gws_init0
39 ; GFX10: liveins: $vgpr0
41 ; GFX10-NEXT: $m0 = S_MOV_B32 -1
42 ; GFX10-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
44 DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
50 tracksRegLiveness: true
54 ; GFX9-LABEL: name: m0_gws_init1
55 ; GFX9: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
56 ; GFX9-NEXT: $m0 = S_MOV_B32 -1
58 ; GFX9-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
59 ; VI-LABEL: name: m0_gws_init1
60 ; VI: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
61 ; VI-NEXT: $m0 = S_MOV_B32 -1
63 ; VI-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
64 ; CI-LABEL: name: m0_gws_init1
65 ; CI: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
66 ; CI-NEXT: $m0 = S_MOV_B32 -1
67 ; CI-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
68 ; SI-LABEL: name: m0_gws_init1
69 ; SI: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
70 ; SI-NEXT: $m0 = S_MOV_B32 -1
71 ; SI-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
72 ; GFX10-LABEL: name: m0_gws_init1
73 ; GFX10: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
74 ; GFX10-NEXT: $m0 = S_MOV_B32 -1
75 ; GFX10-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
76 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
78 DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
82 # Test a typical situation where m0 needs to be set from a VGPR
83 # through readfirstlane
86 tracksRegLiveness: true
90 liveins: $vgpr0, $vgpr1
92 ; GFX9-LABEL: name: m0_gws_readlane
93 ; GFX9: liveins: $vgpr0, $vgpr1
95 ; GFX9-NEXT: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
96 ; GFX9-NEXT: $m0 = S_MOV_B32 $sgpr0
98 ; GFX9-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
99 ; VI-LABEL: name: m0_gws_readlane
100 ; VI: liveins: $vgpr0, $vgpr1
102 ; VI-NEXT: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
103 ; VI-NEXT: $m0 = S_MOV_B32 $sgpr0
105 ; VI-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
106 ; CI-LABEL: name: m0_gws_readlane
107 ; CI: liveins: $vgpr0, $vgpr1
109 ; CI-NEXT: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
110 ; CI-NEXT: $m0 = S_MOV_B32 $sgpr0
111 ; CI-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
112 ; SI-LABEL: name: m0_gws_readlane
113 ; SI: liveins: $vgpr0, $vgpr1
115 ; SI-NEXT: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
116 ; SI-NEXT: $m0 = S_MOV_B32 $sgpr0
117 ; SI-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
118 ; GFX10-LABEL: name: m0_gws_readlane
119 ; GFX10: liveins: $vgpr0, $vgpr1
121 ; GFX10-NEXT: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
122 ; GFX10-NEXT: $m0 = S_MOV_B32 $sgpr0
123 ; GFX10-NEXT: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
124 $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
125 $m0 = S_MOV_B32 $sgpr0
126 DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec