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
9 tracksRegLiveness: true
14 ; GFX9-LABEL: name: m0_gws_init0
15 ; GFX9: liveins: $vgpr0
16 ; GFX9: $m0 = S_MOV_B32 -1
18 ; GFX9: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
19 ; VI-LABEL: name: m0_gws_init0
21 ; VI: $m0 = S_MOV_B32 -1
23 ; VI: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
24 ; CI-LABEL: name: m0_gws_init0
26 ; CI: $m0 = S_MOV_B32 -1
27 ; CI: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
28 ; SI-LABEL: name: m0_gws_init0
30 ; SI: $m0 = S_MOV_B32 -1
31 ; SI: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
33 DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
39 tracksRegLiveness: true
43 ; GFX9-LABEL: name: m0_gws_init1
44 ; GFX9: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
45 ; GFX9: $m0 = S_MOV_B32 -1
47 ; GFX9: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
48 ; VI-LABEL: name: m0_gws_init1
49 ; VI: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
50 ; VI: $m0 = S_MOV_B32 -1
52 ; VI: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
53 ; CI-LABEL: name: m0_gws_init1
54 ; CI: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
55 ; CI: $m0 = S_MOV_B32 -1
56 ; CI: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
57 ; SI-LABEL: name: m0_gws_init1
58 ; SI: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
59 ; SI: $m0 = S_MOV_B32 -1
60 ; SI: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
61 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
63 DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
67 # Test a typical situation where m0 needs to be set from a VGPR
68 # through readfirstlane
71 tracksRegLiveness: true
75 liveins: $vgpr0, $vgpr1
77 ; GFX9-LABEL: name: m0_gws_readlane
78 ; GFX9: liveins: $vgpr0, $vgpr1
79 ; GFX9: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
80 ; GFX9: $m0 = S_MOV_B32 $sgpr0
82 ; GFX9: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
83 ; VI-LABEL: name: m0_gws_readlane
84 ; VI: liveins: $vgpr0, $vgpr1
85 ; VI: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
86 ; VI: $m0 = S_MOV_B32 $sgpr0
88 ; VI: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
89 ; CI-LABEL: name: m0_gws_readlane
90 ; CI: liveins: $vgpr0, $vgpr1
91 ; CI: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
92 ; CI: $m0 = S_MOV_B32 $sgpr0
93 ; CI: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
94 ; SI-LABEL: name: m0_gws_readlane
95 ; SI: liveins: $vgpr0, $vgpr1
96 ; SI: $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
97 ; SI: $m0 = S_MOV_B32 $sgpr0
98 ; SI: DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec
99 $sgpr0 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
100 $m0 = S_MOV_B32 $sgpr0
101 DS_GWS_INIT $vgpr0, 0, 1, implicit $m0, implicit $exec