48 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 52# RUN: llc -mtriple=aarch64 -o - %s -run-pass machine-sink | FileCheck %s3 4# we want to fuse an addition with lsl into an ldr but we have to be careful with5# the shift distance: we can only represent specific shift distances: e.g: 36# but nothing large like 327 8--- |9 define dso_local i64 @fuse_shift_add_into_addr_mode() {10 entry:11 ret i64 012 }13 14---15name: fuse_shift_add_into_addr_mode16body: |17 bb.1.entry:18 liveins: $x0, $x119 20 ; CHECK-LABEL: name: fuse_shift_add_into_addr_mode21 ; CHECK: liveins: $x0, $x122 ; CHECK-NEXT: {{ $}}23 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64common = COPY $x024 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x125 ; CHECK-NEXT: [[LDRXroX:%[0-9]+]]:gpr64 = LDRXroX [[COPY]], [[COPY1]], 0, 1 :: (load (s64))26 ; CHECK-NEXT: [[ADDXrs:%[0-9]+]]:gpr64common = ADDXrs [[COPY]], [[COPY1]], 527 ; CHECK-NEXT: [[LDRXui:%[0-9]+]]:gpr64 = LDRXui [[ADDXrs]], 0 :: (load (s64))28 ; CHECK-NEXT: [[ADDXrs1:%[0-9]+]]:gpr64common = ADDXrs [[COPY]], [[COPY1]], 3229 ; CHECK-NEXT: [[LDRXui1:%[0-9]+]]:gpr64 = LDRXui [[ADDXrs1]], 0 :: (load (s64))30 ; CHECK-NEXT: [[ADDXrs2:%[0-9]+]]:gpr64common = ADDXrs [[COPY]], [[COPY1]], 3531 ; CHECK-NEXT: [[LDRXui2:%[0-9]+]]:gpr64 = LDRXui [[ADDXrs1]], 0 :: (load (s64))32 ; CHECK-NEXT: [[ADDXrs3:%[0-9]+]]:gpr64common = ADDXrs [[COPY]], [[COPY1]], 6333 ; CHECK-NEXT: [[LDRXui3:%[0-9]+]]:gpr64 = LDRXui [[ADDXrs1]], 0 :: (load (s64))34 ; CHECK-NEXT: RET_ReallyLR implicit $x035 %0:gpr64 = COPY $x036 %1:gpr64 = COPY $x137 %2:gpr64common = ADDXrs %0, %1, 338 %3:gpr64 = LDRXui %2, 0 :: (load (s64))39 %4:gpr64common = ADDXrs %0, %1, 540 %5:gpr64 = LDRXui %4, 0 :: (load (s64))41 %6:gpr64common = ADDXrs %0, %1, 3242 %7:gpr64 = LDRXui %6, 0 :: (load (s64))43 %8:gpr64common = ADDXrs %0, %1, 3544 %9:gpr64 = LDRXui %6, 0 :: (load (s64))45 %10:gpr64common = ADDXrs %0, %1, 6346 %11:gpr64 = LDRXui %6, 0 :: (load (s64))47 RET_ReallyLR implicit $x048