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
10 tracksRegLiveness: true
15 ; GFX9-LABEL: name: m0_gws_init0
16 ; GFX9: liveins: $vgpr0
17 ; GFX9: $m0 = S_MOV_B32 -1
19 ; GFX9: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
20 ; VI-LABEL: name: m0_gws_init0
22 ; VI: $m0 = S_MOV_B32 -1
24 ; VI: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
25 ; CI-LABEL: name: m0_gws_init0
27 ; CI: $m0 = S_MOV_B32 -1
28 ; CI: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
29 ; SI-LABEL: name: m0_gws_init0
31 ; SI: $m0 = S_MOV_B32 -1
32 ; SI: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
33 ; GFX10-LABEL: name: m0_gws_init0
34 ; GFX10: liveins: $vgpr0
35 ; GFX10: $m0 = S_MOV_B32 -1
36 ; GFX10: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
38 DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
44 tracksRegLiveness: true
48 ; GFX9-LABEL: name: m0_gws_init1
49 ; GFX9: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
50 ; GFX9: $m0 = S_MOV_B32 -1
52 ; GFX9: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
53 ; VI-LABEL: name: m0_gws_init1
54 ; VI: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
55 ; VI: $m0 = S_MOV_B32 -1
57 ; VI: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
58 ; CI-LABEL: name: m0_gws_init1
59 ; CI: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
60 ; CI: $m0 = S_MOV_B32 -1
61 ; CI: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
62 ; SI-LABEL: name: m0_gws_init1
63 ; SI: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
64 ; SI: $m0 = S_MOV_B32 -1
65 ; SI: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
66 ; GFX10-LABEL: name: m0_gws_init1
67 ; GFX10: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
68 ; GFX10: $m0 = S_MOV_B32 -1
69 ; GFX10: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
70 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
72 DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
76 # Test a typical situation where m0 needs to be set from a VGPR
77 # through readfirstlane
80 tracksRegLiveness: true
84 liveins: $vgpr0, $vgpr1
86 ; GFX9-LABEL: name: m0_gws_readlane
87 ; GFX9: liveins: $vgpr0, $vgpr1
88 ; GFX9: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
89 ; GFX9: $m0 = S_MOV_B32 $sgpr0
91 ; GFX9: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
92 ; VI-LABEL: name: m0_gws_readlane
93 ; VI: liveins: $vgpr0, $vgpr1
94 ; VI: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
95 ; VI: $m0 = S_MOV_B32 $sgpr0
97 ; VI: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
98 ; CI-LABEL: name: m0_gws_readlane
99 ; CI: liveins: $vgpr0, $vgpr1
100 ; CI: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
101 ; CI: $m0 = S_MOV_B32 $sgpr0
102 ; CI: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
103 ; SI-LABEL: name: m0_gws_readlane
104 ; SI: liveins: $vgpr0, $vgpr1
105 ; SI: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
106 ; SI: $m0 = S_MOV_B32 $sgpr0
107 ; SI: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
108 ; GFX10-LABEL: name: m0_gws_readlane
109 ; GFX10: liveins: $vgpr0, $vgpr1
110 ; GFX10: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
111 ; GFX10: $m0 = S_MOV_B32 $sgpr0
112 ; GFX10: DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec
113 $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
114 $m0 = S_MOV_B32 $sgpr0
115 DS_GWS_INIT $vgpr0, 0, implicit $m0, implicit $exec