106 lines · plain
1# RUN: llc -mtriple=aarch64-linux-gnu -verify-machineinstrs -run-pass=aarch64-ldst-opt %s -o - | FileCheck %s2#3# When the AArch64 Load Store Optimization pass tries to convert load instructions4# into a ldp instruction, and when the base register of the second ldr instruction5# has been modified in between these two ldr instructions, the conversion should not6# occur.7#8# For example, for the following pattern:9# ldr x9 [x10]10# ldr x10 [x8]11# ldr x10 [x10, 8],12# the first and third ldr instructions cannot be converted to ldp x9, x10, [x10].13#14# CHECK-LABEL: name: ldr-modified-baseReg-no-ldp115# CHECK-NOT: LDP16# CHECK: $x9 = LDRXui $x10, 1 :: (load (s64))17# CHECK: $x10 = LDURXi $x8, 1 :: (load (s64))18# CHECK: $x10 = LDRXui $x10, 0 :: (load (s64))19# CHECK: RET20---21name: ldr-modified-baseReg-no-ldp122tracksRegLiveness: true23body: |24 bb.0:25 liveins: $x8, $x1026 27 $x9 = LDRXui $x10, 1 :: (load (s64))28 $x10 = LDURXi $x8, 1 :: (load (s64))29 $x10 = LDRXui $x10, 0 :: (load (s64))30 RET undef $lr, implicit undef $w031...32 33# CHECK-LABEL: name: str-modified-baseReg-no-stp134# CHECK-NOT: STP35# CHECK: STRXui $x9, $x10, 1 :: (store (s64))36# CHECK: $x10 = LDRXui $x8, 0 :: (load (s64))37# CHECK: STRXui $x10, $x10, 0 :: (store (s64))38# CHECK: RET39---40name: str-modified-baseReg-no-stp141tracksRegLiveness: true42body: |43 bb.0:44 liveins: $x9, $x8, $x1045 46 STRXui $x9, $x10, 1 :: (store (s64))47 $x10 = LDRXui $x8, 0 :: (load (s64))48 STRXui $x10, $x10, 0 :: (store (s64))49 RET undef $lr, implicit undef $w050...51 52# CHECK-LABEL: name: ldr-modified-baseReg-no-ldp253# CHECK-NOT: LDP54# CHECK: $x9 = LDRXui $x10, 1 :: (load (s64))55# CHECK: $x10 = MOVi64imm 1356# CHECK: $x11 = LDRXui $x10, 0 :: (load (s64))57# CHECK: RET58---59name: ldr-modified-baseReg-no-ldp260tracksRegLiveness: true61body: |62 bb.0:63 liveins: $x8, $x1064 65 $x9 = LDRXui $x10, 1 :: (load (s64))66 $x10 = MOVi64imm 1367 $x11 = LDRXui $x10, 0 :: (load (s64))68 RET undef $lr, implicit undef $w069...70 71# CHECK-LABEL: name: ldr-modified-baseReg-no-ldp372# CHECK-NOT: LDP73# CHECK: $x9 = LDRXui $x10, 1 :: (load (s64))74# CHECK: $x10 = ADDXri $x8, $x11, 075# CHECK: $x12 = LDRXui $x10, 0 :: (load (s64))76# CHECK: RET77---78name: ldr-modified-baseReg-no-ldp379tracksRegLiveness: true80body: |81 bb.0:82 liveins: $x8, $x10, $x1183 84 $x9 = LDRXui $x10, 1 :: (load (s64))85 $x10 = ADDXri $x8, $x11, 086 $x12 = LDRXui $x10, 0 :: (load (s64))87 RET undef $lr, implicit undef $w088...89 90# CHECK-LABEL: name: ldr-modified-baseAddr-convert-to-ldp91# CHECK: $x12, $x9 = LDPXi $x10, 0 :: (load (s64))92# CHECK: STRXui $x11, $x10, 1 :: (store (s64))93# CHECK: RET94---95name: ldr-modified-baseAddr-convert-to-ldp96tracksRegLiveness: true97body: |98 bb.0:99 liveins: $x8, $x10, $x11100 101 $x9 = LDRXui $x10, 1 :: (load (s64))102 STRXui $x11, $x10, 1 :: (store (s64))103 $x12 = LDRXui $x10, 0 :: (load (s64))104 RET undef $lr, implicit undef $w0105...106