1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
6 tracksRegLiveness: true
13 ; CHECK-LABEL: name: shl_by_ge_bw
16 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
17 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[DEF]](s16)
18 ; CHECK-NEXT: $w0 = COPY [[ANYEXT]](s32)
19 ; CHECK-NEXT: RET_ReallyLR implicit $w0
21 %0:_(s16) = G_TRUNC %1(s32)
22 %2:_(s16) = G_CONSTANT i16 20
23 %3:_(s16) = G_SHL %0, %2(s16)
24 %4:_(s32) = G_ANYEXT %3(s16)
26 RET_ReallyLR implicit $w0
32 tracksRegLiveness: true
39 ; CHECK-LABEL: name: lshr_by_ge_bw
42 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
43 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[DEF]](s16)
44 ; CHECK-NEXT: $w0 = COPY [[ANYEXT]](s32)
45 ; CHECK-NEXT: RET_ReallyLR implicit $w0
47 %0:_(s16) = G_TRUNC %1(s32)
48 %2:_(s16) = G_CONSTANT i16 16
49 %3:_(s16) = G_LSHR %0, %2(s16)
50 %4:_(s32) = G_ANYEXT %3(s16)
52 RET_ReallyLR implicit $w0
58 tracksRegLiveness: true
65 ; CHECK-LABEL: name: ashr_by_ge_bw
68 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
69 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[DEF]](s16)
70 ; CHECK-NEXT: $w0 = COPY [[ANYEXT]](s32)
71 ; CHECK-NEXT: RET_ReallyLR implicit $w0
73 %0:_(s16) = G_TRUNC %1(s32)
74 %2:_(s16) = G_CONSTANT i16 20
75 %3:_(s16) = G_ASHR %0, %2(s16)
76 %4:_(s32) = G_ANYEXT %3(s16)
78 RET_ReallyLR implicit $w0
82 name: shl_by_ge_bw_vector
84 tracksRegLiveness: true
91 ; CHECK-LABEL: name: shl_by_ge_bw_vector
94 ; CHECK-NEXT: %shl:_(<4 x s32>) = G_IMPLICIT_DEF
95 ; CHECK-NEXT: $q0 = COPY %shl(<4 x s32>)
96 ; CHECK-NEXT: RET_ReallyLR implicit $q0
97 %1:_(<4 x s32>) = COPY $q0
98 %0:_(s32) = G_CONSTANT i32 32
99 %bv:_(<4 x s32>) = G_BUILD_VECTOR %0, %0, %0, %0
100 %shl:_(<4 x s32>) = G_SHL %1, %bv(<4 x s32>)
101 $q0 = COPY %shl(<4 x s32>)
102 RET_ReallyLR implicit $q0
106 name: shl_by_ge_bw_vector_partial
108 tracksRegLiveness: true
115 ; CHECK-LABEL: name: shl_by_ge_bw_vector_partial
116 ; CHECK: liveins: $q0
118 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
119 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
120 ; CHECK-NEXT: %small:_(s32) = G_CONSTANT i32 4
121 ; CHECK-NEXT: %bv:_(<4 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), %small(s32)
122 ; CHECK-NEXT: %shl:_(<4 x s32>) = G_SHL [[COPY]], %bv(<4 x s32>)
123 ; CHECK-NEXT: $q0 = COPY %shl(<4 x s32>)
124 ; CHECK-NEXT: RET_ReallyLR implicit $q0
125 %1:_(<4 x s32>) = COPY $q0
126 %0:_(s32) = G_CONSTANT i32 32
127 %small:_(s32) = G_CONSTANT i32 4
128 %bv:_(<4 x s32>) = G_BUILD_VECTOR %0, %0, %0, %small
129 %shl:_(<4 x s32>) = G_SHL %1, %bv(<4 x s32>)
130 $q0 = COPY %shl(<4 x s32>)
131 RET_ReallyLR implicit $q0