1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -run-pass=amdgpu-postlegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
5 name: trunc_s32_shl_s64_5
7 tracksRegLiveness: true
12 ; CHECK-LABEL: name: trunc_s32_shl_s64_5
13 ; CHECK: liveins: $vgpr0_vgpr1
14 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
15 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
16 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
17 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[TRUNC]], [[C]](s32)
18 ; CHECK: $vgpr0 = COPY [[SHL]](s32)
19 %0:_(s64) = COPY $vgpr0_vgpr1
20 %1:_(s32) = G_CONSTANT i32 1
21 %2:_(s64) = G_SHL %0:_, %1
22 %3:_(s32) = G_TRUNC %2
27 name: trunc_s16_shl_s32_5
29 tracksRegLiveness: true
34 ; CHECK-LABEL: name: trunc_s16_shl_s32_5
35 ; CHECK: liveins: $vgpr0
36 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
37 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
38 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
39 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
40 ; CHECK: S_ENDPGM 0, implicit [[TRUNC]](s16)
41 %0:_(s32) = COPY $vgpr0
42 %1:_(s32) = G_CONSTANT i32 1
43 %2:_(s32) = G_SHL %0:_, %1
44 %3:_(s16) = G_TRUNC %2
45 S_ENDPGM 0, implicit %3
50 name: trunc_s16_shl_s64_5
52 tracksRegLiveness: true
57 ; CHECK-LABEL: name: trunc_s16_shl_s64_5
58 ; CHECK: liveins: $vgpr0_vgpr1
59 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
60 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
61 ; CHECK: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s32)
62 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s64)
63 ; CHECK: S_ENDPGM 0, implicit [[TRUNC]](s16)
64 %0:_(s64) = COPY $vgpr0_vgpr1
65 %1:_(s32) = G_CONSTANT i32 1
66 %2:_(s64) = G_SHL %0:_, %1
67 %3:_(s16) = G_TRUNC %2
68 S_ENDPGM 0, implicit %3