1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer %s -o - | FileCheck %s
5 name: test_constant_s32
9 ; CHECK-LABEL: name: test_constant_s32
10 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5
11 ; CHECK-NEXT: $vgpr0 = COPY [[C]](s32)
12 %0:_(s32) = G_CONSTANT i32 5
16 name: test_constant_s64
20 ; CHECK-LABEL: name: test_constant_s64
21 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 5
22 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[C]](s64)
23 %0:_(s64) = G_CONSTANT i64 5
24 $vgpr0_vgpr1 = COPY %0
29 name: test_constant_s96
33 ; CHECK-LABEL: name: test_constant_s96
34 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -4780896129847249538
35 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -547834910
36 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[C]](s64)
37 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s96) = G_MERGE_VALUES [[UV]](s32), [[UV1]](s32), [[C1]](s32)
38 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2 = COPY [[MV]](s96)
39 %0:_(s96) = G_CONSTANT i96 -10105770365747857631829412482
40 $vgpr0_vgpr1_vgpr2 = COPY %0
45 name: test_constant_s1
49 ; CHECK-LABEL: name: test_constant_s1
50 ; CHECK: [[C:%[0-9]+]]:_(s1) = G_CONSTANT i1 false
51 ; CHECK-NEXT: S_ENDPGM 0, implicit [[C]](s1)
52 %1:_(s1) = G_CONSTANT i1 0
53 S_ENDPGM 0, implicit %1
57 name: test_constant_s7
61 ; CHECK-LABEL: name: test_constant_s7
62 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5
63 ; CHECK-NEXT: $vgpr0 = COPY [[C]](s32)
64 %0:_(s7) = G_CONSTANT i7 5
65 %1:_(s32) = G_ANYEXT %0
70 name: test_constant_s8
74 ; CHECK-LABEL: name: test_constant_s8
75 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5
76 ; CHECK-NEXT: $vgpr0 = COPY [[C]](s32)
77 %0:_(s8) = G_CONSTANT i8 5
78 %1:_(s32) = G_ANYEXT %0
83 name: test_constant_s16
87 ; CHECK-LABEL: name: test_constant_s16
88 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5
89 ; CHECK-NEXT: $vgpr0 = COPY [[C]](s32)
90 %0:_(s16) = G_CONSTANT i16 5
91 %1:_(s32) = G_ANYEXT %0
96 name: test_constant_s128
100 ; CHECK-LABEL: name: test_constant_s128
101 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 5
102 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
103 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[C]](s64), [[C1]](s64)
104 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[MV]](s128)
105 %0:_(s128) = G_CONSTANT i128 5
106 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %0
110 name: test_constant_p0
114 ; CHECK-LABEL: name: test_constant_p0
115 ; CHECK: [[C:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
116 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[C]](p0)
117 %0:_(p0) = G_CONSTANT i64 0
118 $vgpr0_vgpr1 = COPY %0
122 name: test_constant_p1
126 ; CHECK-LABEL: name: test_constant_p1
127 ; CHECK: [[C:%[0-9]+]]:_(p1) = G_CONSTANT i64 0
128 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[C]](p1)
129 %0:_(p1) = G_CONSTANT i64 0
130 $vgpr0_vgpr1 = COPY %0
134 name: test_constant_p2
138 ; CHECK-LABEL: name: test_constant_p2
139 ; CHECK: [[C:%[0-9]+]]:_(p2) = G_CONSTANT i32 0
140 ; CHECK-NEXT: $vgpr0 = COPY [[C]](p2)
141 %0:_(p2) = G_CONSTANT i32 0
146 name: test_constant_p3
150 ; CHECK-LABEL: name: test_constant_p3
151 ; CHECK: [[C:%[0-9]+]]:_(p2) = G_CONSTANT i32 0
152 ; CHECK-NEXT: $vgpr0 = COPY [[C]](p2)
153 %0:_(p2) = G_CONSTANT i32 0
158 name: test_constant_p4
162 ; CHECK-LABEL: name: test_constant_p4
163 ; CHECK: [[C:%[0-9]+]]:_(p4) = G_CONSTANT i64 0
164 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[C]](p4)
165 %0:_(p4) = G_CONSTANT i64 0
166 $vgpr0_vgpr1 = COPY %0
170 name: test_constant_p5
174 ; CHECK-LABEL: name: test_constant_p5
175 ; CHECK: [[C:%[0-9]+]]:_(p5) = G_CONSTANT i32 0
176 ; CHECK-NEXT: $vgpr0 = COPY [[C]](p5)
177 %0:_(p5) = G_CONSTANT i32 0
182 name: test_constant_p999
186 ; CHECK-LABEL: name: test_constant_p999
187 ; CHECK: [[C:%[0-9]+]]:_(p999) = G_CONSTANT i64 0
188 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[C]](p999)
189 %0:_(p999) = G_CONSTANT i64 0
190 $vgpr0_vgpr1 = COPY %0