1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -o - %s  | FileCheck -check-prefix=GFX8 %s
3# RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs -o - %s  | FileCheck -check-prefix=GFX9 %s
4# RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs -o - %s  | FileCheck -check-prefix=GFX10 %s
5
6---
7
8name:            or_s32_sgpr_sgpr_sgpr
9legalized:       true
10regBankSelected: true
11tracksRegLiveness: true
12
13body: |
14  bb.0:
15    liveins: $sgpr0, $sgpr1, $sgpr2
16    ; GFX8-LABEL: name: or_s32_sgpr_sgpr_sgpr
17    ; GFX8: liveins: $sgpr0, $sgpr1, $sgpr2
18    ; GFX8: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
19    ; GFX8: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
20    ; GFX8: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
21    ; GFX8: [[S_OR_B32_:%[0-9]+]]:sreg_32 = S_OR_B32 [[COPY]], [[COPY1]], implicit-def $scc
22    ; GFX8: [[S_OR_B32_1:%[0-9]+]]:sreg_32 = S_OR_B32 [[S_OR_B32_]], [[COPY2]], implicit-def $scc
23    ; GFX8: S_ENDPGM 0, implicit [[S_OR_B32_1]]
24    ; GFX9-LABEL: name: or_s32_sgpr_sgpr_sgpr
25    ; GFX9: liveins: $sgpr0, $sgpr1, $sgpr2
26    ; GFX9: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
27    ; GFX9: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
28    ; GFX9: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
29    ; GFX9: [[S_OR_B32_:%[0-9]+]]:sreg_32 = S_OR_B32 [[COPY]], [[COPY1]], implicit-def $scc
30    ; GFX9: [[S_OR_B32_1:%[0-9]+]]:sreg_32 = S_OR_B32 [[S_OR_B32_]], [[COPY2]], implicit-def $scc
31    ; GFX9: S_ENDPGM 0, implicit [[S_OR_B32_1]]
32    ; GFX10-LABEL: name: or_s32_sgpr_sgpr_sgpr
33    ; GFX10: liveins: $sgpr0, $sgpr1, $sgpr2
34    ; GFX10: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
35    ; GFX10: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
36    ; GFX10: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
37    ; GFX10: [[S_OR_B32_:%[0-9]+]]:sreg_32 = S_OR_B32 [[COPY]], [[COPY1]], implicit-def $scc
38    ; GFX10: [[S_OR_B32_1:%[0-9]+]]:sreg_32 = S_OR_B32 [[S_OR_B32_]], [[COPY2]], implicit-def $scc
39    ; GFX10: S_ENDPGM 0, implicit [[S_OR_B32_1]]
40    %0:sgpr(s32) = COPY $sgpr0
41    %1:sgpr(s32) = COPY $sgpr1
42    %2:sgpr(s32) = COPY $sgpr2
43    %3:sgpr(s32) = G_OR %0, %1
44    %4:sgpr(s32) = G_OR %3, %2
45    S_ENDPGM 0, implicit %4
46...
47
48---
49
50name:            or_s32_vgpr_vgpr_vgpr
51legalized:       true
52regBankSelected: true
53tracksRegLiveness: true
54
55body: |
56  bb.0:
57    liveins: $vgpr0, $vgpr1, $vgpr2
58    ; GFX8-LABEL: name: or_s32_vgpr_vgpr_vgpr
59    ; GFX8: liveins: $vgpr0, $vgpr1, $vgpr2
60    ; GFX8: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
61    ; GFX8: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
62    ; GFX8: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
63    ; GFX8: [[V_OR_B32_e64_:%[0-9]+]]:vgpr_32 = V_OR_B32_e64 [[COPY]], [[COPY1]], implicit $exec
64    ; GFX8: [[V_OR_B32_e64_1:%[0-9]+]]:vgpr_32 = V_OR_B32_e64 [[V_OR_B32_e64_]], [[COPY2]], implicit $exec
65    ; GFX8: S_ENDPGM 0, implicit [[V_OR_B32_e64_1]]
66    ; GFX9-LABEL: name: or_s32_vgpr_vgpr_vgpr
67    ; GFX9: liveins: $vgpr0, $vgpr1, $vgpr2
68    ; GFX9: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
69    ; GFX9: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
70    ; GFX9: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
71    ; GFX9: [[V_OR3_B32_:%[0-9]+]]:vgpr_32 = V_OR3_B32 [[COPY]], [[COPY1]], [[COPY2]], implicit $exec
72    ; GFX9: S_ENDPGM 0, implicit [[V_OR3_B32_]]
73    ; GFX10-LABEL: name: or_s32_vgpr_vgpr_vgpr
74    ; GFX10: liveins: $vgpr0, $vgpr1, $vgpr2
75    ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
76    ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
77    ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
78    ; GFX10: [[V_OR3_B32_:%[0-9]+]]:vgpr_32 = V_OR3_B32 [[COPY]], [[COPY1]], [[COPY2]], implicit $exec
79    ; GFX10: S_ENDPGM 0, implicit [[V_OR3_B32_]]
80    %0:vgpr(s32) = COPY $vgpr0
81    %1:vgpr(s32) = COPY $vgpr1
82    %2:vgpr(s32) = COPY $vgpr2
83    %3:vgpr(s32) = G_OR %0, %1
84    %4:vgpr(s32) = G_OR %3, %2
85    S_ENDPGM 0, implicit %4
86...
87
88---
89
90name:            or_s32_vgpr_vgpr_vgpr_multi_use
91legalized:       true
92regBankSelected: true
93tracksRegLiveness: true
94
95body: |
96  bb.0:
97    liveins: $vgpr0, $vgpr1, $vgpr2
98    ; GFX8-LABEL: name: or_s32_vgpr_vgpr_vgpr_multi_use
99    ; GFX8: liveins: $vgpr0, $vgpr1, $vgpr2
100    ; GFX8: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
101    ; GFX8: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
102    ; GFX8: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
103    ; GFX8: [[V_OR_B32_e64_:%[0-9]+]]:vgpr_32 = V_OR_B32_e64 [[COPY]], [[COPY1]], implicit $exec
104    ; GFX8: [[V_OR_B32_e64_1:%[0-9]+]]:vgpr_32 = V_OR_B32_e64 [[V_OR_B32_e64_]], [[COPY2]], implicit $exec
105    ; GFX8: S_ENDPGM 0, implicit [[V_OR_B32_e64_1]], implicit [[V_OR_B32_e64_]]
106    ; GFX9-LABEL: name: or_s32_vgpr_vgpr_vgpr_multi_use
107    ; GFX9: liveins: $vgpr0, $vgpr1, $vgpr2
108    ; GFX9: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
109    ; GFX9: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
110    ; GFX9: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
111    ; GFX9: [[V_OR_B32_e64_:%[0-9]+]]:vgpr_32 = V_OR_B32_e64 [[COPY]], [[COPY1]], implicit $exec
112    ; GFX9: [[V_OR_B32_e64_1:%[0-9]+]]:vgpr_32 = V_OR_B32_e64 [[V_OR_B32_e64_]], [[COPY2]], implicit $exec
113    ; GFX9: S_ENDPGM 0, implicit [[V_OR_B32_e64_1]], implicit [[V_OR_B32_e64_]]
114    ; GFX10-LABEL: name: or_s32_vgpr_vgpr_vgpr_multi_use
115    ; GFX10: liveins: $vgpr0, $vgpr1, $vgpr2
116    ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
117    ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
118    ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
119    ; GFX10: [[V_OR_B32_e64_:%[0-9]+]]:vgpr_32 = V_OR_B32_e64 [[COPY]], [[COPY1]], implicit $exec
120    ; GFX10: [[V_OR_B32_e64_1:%[0-9]+]]:vgpr_32 = V_OR_B32_e64 [[V_OR_B32_e64_]], [[COPY2]], implicit $exec
121    ; GFX10: S_ENDPGM 0, implicit [[V_OR_B32_e64_1]], implicit [[V_OR_B32_e64_]]
122    %0:vgpr(s32) = COPY $vgpr0
123    %1:vgpr(s32) = COPY $vgpr1
124    %2:vgpr(s32) = COPY $vgpr2
125    %3:vgpr(s32) = G_OR %0, %1
126    %4:vgpr(s32) = G_OR %3, %2
127    S_ENDPGM 0, implicit %4, implicit %3
128...
129
130