1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-unknown-unknown -verify-machineinstrs -run-pass=instruction-select -global-isel-abort=1 %s -o - | FileCheck %s
8 tracksRegLiveness: true
15 ; Our codegen differs from SDAG here, we decide to fold in LHS
16 ; operand instead of RHS since they're both rotates and XOR is commutative.
19 ; CHECK-LABEL: name: fold_ror_eor
21 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
22 ; CHECK: [[EXTRWrri:%[0-9]+]]:gpr32 = EXTRWrri [[COPY]], [[COPY]], 11
23 ; CHECK: [[EORWrs:%[0-9]+]]:gpr32 = EORWrs [[EXTRWrri]], [[COPY]], 198
24 ; CHECK: $w0 = COPY [[EORWrs]]
25 ; CHECK: RET_ReallyLR implicit $w0
26 %0:gpr(s32) = COPY $w0
27 %13:gpr(s64) = G_CONSTANT i64 6
28 %2:gpr(s32) = G_ROTR %0, %13(s64)
29 %14:gpr(s64) = G_CONSTANT i64 11
30 %4:gpr(s32) = G_ROTR %0, %14(s64)
31 %5:gpr(s32) = G_XOR %2, %4
33 RET_ReallyLR implicit $w0
37 name: fold_ror_eor_rhs_only
41 tracksRegLiveness: true
47 machineFunctionInfo: {}
52 ; CHECK-LABEL: name: fold_ror_eor_rhs_only
53 ; CHECK: liveins: $w0, $w1
54 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
55 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
56 ; CHECK: [[EORWrs:%[0-9]+]]:gpr32 = EORWrs [[COPY1]], [[COPY]], 198
57 ; CHECK: $w0 = COPY [[EORWrs]]
58 ; CHECK: RET_ReallyLR implicit $w0
59 %0:gpr(s32) = COPY $w0
60 %1:gpr(s32) = COPY $w1
61 %9:gpr(s64) = G_CONSTANT i64 6
62 %3:gpr(s32) = G_ROTR %0, %9(s64)
63 %4:gpr(s32) = G_XOR %1, %3
65 RET_ReallyLR implicit $w0