1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=legalizer -global-isel-abort=0 %s -o - | FileCheck %s
3 # FIXME: Remove -global-isel-abort=0 when G_TRUNC legality handled
6 name: test_anyext_trunc_v2s32_to_v2s16_to_v2s32
11 ; CHECK-LABEL: name: test_anyext_trunc_v2s32_to_v2s16_to_v2s32
12 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
13 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY [[COPY]](<2 x s32>)
14 ; CHECK: $vgpr0_vgpr1 = COPY [[COPY1]](<2 x s32>)
15 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
16 %1:_(<2 x s16>) = G_TRUNC %0
17 %2:_(<2 x s32>) = G_ANYEXT %1
18 $vgpr0_vgpr1 = COPY %2
22 name: test_anyext_trunc_v2s32_to_v2s16_to_v2s64
27 ; CHECK-LABEL: name: test_anyext_trunc_v2s32_to_v2s16_to_v2s64
28 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
29 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
30 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
31 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
32 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[ANYEXT]](s64), [[ANYEXT1]](s64)
33 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>)
34 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
35 %1:_(<2 x s16>) = G_TRUNC %0
36 %2:_(<2 x s64>) = G_ANYEXT %1
37 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %2
41 name: test_anyext_trunc_v2s32_to_v2s8_to_v2s16
46 ; CHECK-LABEL: name: test_anyext_trunc_v2s32_to_v2s8_to_v2s16
47 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
48 ; CHECK: [[TRUNC:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[COPY]](<2 x s32>)
49 ; CHECK: $vgpr0 = COPY [[TRUNC]](<2 x s16>)
50 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
51 %1:_(<2 x s8>) = G_TRUNC %0
52 %2:_(<2 x s16>) = G_ANYEXT %1
57 name: test_anyext_trunc_v3s32_to_v3s16_to_v3s32
60 liveins: $vgpr0_vgpr1_vgpr2
62 ; CHECK-LABEL: name: test_anyext_trunc_v3s32_to_v3s16_to_v3s32
63 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
64 ; CHECK: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY [[COPY]](<3 x s32>)
65 ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[COPY1]](<3 x s32>)
66 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
67 %1:_(<3 x s16>) = G_TRUNC %0
68 %2:_(<3 x s32>) = G_ANYEXT %1
69 $vgpr0_vgpr1_vgpr2 = COPY %2