1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -run-pass=aarch64-postlegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
4 # Check that we simplify the constant rotate amount to be in range.
9 tracksRegLiveness: true
16 ; CHECK-LABEL: name: rotl
18 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
19 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
20 ; CHECK: [[ROTL:%[0-9]+]]:_(s32) = G_ROTL [[COPY]], [[C]](s64)
21 ; CHECK: $w0 = COPY [[ROTL]](s32)
22 ; CHECK: RET_ReallyLR implicit $w0
24 %5:_(s64) = G_CONSTANT i64 -16
25 %2:_(s32) = G_ROTL %0, %5(s64)
27 RET_ReallyLR implicit $w0
34 tracksRegLiveness: true
41 ; CHECK-LABEL: name: rotr
43 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
44 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
45 ; CHECK: [[ROTR:%[0-9]+]]:_(s32) = G_ROTR [[COPY]], [[C]](s64)
46 ; CHECK: $w0 = COPY [[ROTR]](s32)
47 ; CHECK: RET_ReallyLR implicit $w0
49 %5:_(s64) = G_CONSTANT i64 -16
50 %2:_(s32) = G_ROTR %0, %5(s64)
52 RET_ReallyLR implicit $w0
56 name: rotl_bitwidth_cst
59 tracksRegLiveness: true
66 ; CHECK-LABEL: name: rotl_bitwidth_cst
68 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
69 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
70 ; CHECK: [[ROTL:%[0-9]+]]:_(s32) = G_ROTL [[COPY]], [[C]](s64)
71 ; CHECK: $w0 = COPY [[ROTL]](s32)
72 ; CHECK: RET_ReallyLR implicit $w0
74 %5:_(s64) = G_CONSTANT i64 32
75 %2:_(s32) = G_ROTL %0, %5(s64)
77 RET_ReallyLR implicit $w0
81 name: rotl_bitwidth_minus_one_cst
84 tracksRegLiveness: true
91 ; CHECK-LABEL: name: rotl_bitwidth_minus_one_cst
93 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
94 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 31
95 ; CHECK: [[ROTL:%[0-9]+]]:_(s32) = G_ROTL [[COPY]], [[C]](s64)
96 ; CHECK: $w0 = COPY [[ROTL]](s32)
97 ; CHECK: RET_ReallyLR implicit $w0
99 %5:_(s64) = G_CONSTANT i64 31
100 %2:_(s32) = G_ROTL %0, %5(s64)
102 RET_ReallyLR implicit $w0