1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -run-pass=aarch64-postlegalizer-combiner --aarch64postlegalizercombiner-only-enable-rule="rotate_out_of_range" -verify-machineinstrs %s -o - | FileCheck %s
5 # Check that we simplify the constant rotate amount to be in range.
10 tracksRegLiveness: true
17 ; CHECK-LABEL: name: rotl
19 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
20 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
21 ; CHECK: [[ROTL:%[0-9]+]]:_(s32) = G_ROTL [[COPY]], [[C]](s64)
22 ; CHECK: $w0 = COPY [[ROTL]](s32)
23 ; CHECK: RET_ReallyLR implicit $w0
25 %5:_(s64) = G_CONSTANT i64 -16
26 %2:_(s32) = G_ROTL %0, %5(s64)
28 RET_ReallyLR implicit $w0
35 tracksRegLiveness: true
42 ; CHECK-LABEL: name: rotr
44 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
45 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
46 ; CHECK: [[ROTR:%[0-9]+]]:_(s32) = G_ROTR [[COPY]], [[C]](s64)
47 ; CHECK: $w0 = COPY [[ROTR]](s32)
48 ; CHECK: RET_ReallyLR implicit $w0
50 %5:_(s64) = G_CONSTANT i64 -16
51 %2:_(s32) = G_ROTR %0, %5(s64)
53 RET_ReallyLR implicit $w0
57 name: rotl_bitwidth_cst
60 tracksRegLiveness: true
67 ; CHECK-LABEL: name: rotl_bitwidth_cst
69 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
70 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
71 ; CHECK: [[ROTL:%[0-9]+]]:_(s32) = G_ROTL [[COPY]], [[C]](s64)
72 ; CHECK: $w0 = COPY [[ROTL]](s32)
73 ; CHECK: RET_ReallyLR implicit $w0
75 %5:_(s64) = G_CONSTANT i64 32
76 %2:_(s32) = G_ROTL %0, %5(s64)
78 RET_ReallyLR implicit $w0
82 name: rotl_bitwidth_minus_one_cst
85 tracksRegLiveness: true
92 ; CHECK-LABEL: name: rotl_bitwidth_minus_one_cst
94 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
95 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 31
96 ; CHECK: [[ROTL:%[0-9]+]]:_(s32) = G_ROTL [[COPY]], [[C]](s64)
97 ; CHECK: $w0 = COPY [[ROTL]](s32)
98 ; CHECK: RET_ReallyLR implicit $w0
100 %5:_(s64) = G_CONSTANT i64 31
101 %2:_(s32) = G_ROTL %0, %5(s64)
103 RET_ReallyLR implicit $w0