llvm-project/llvm/test/CodeGen/AArch64/ldst-opt-dbg-limit.mir

134 lines
3.2 KiB
YAML

# RUN: llc -run-pass=aarch64-ldst-opt %s -o - 2>&1 | FileCheck %s
--- |
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64--linux-gnu"
; Function Attrs: nounwind
define i16 @promote-load-from-store(i32* %dst, i32 %x) #0 {
store i32 %x, i32* %dst
%dst16 = bitcast i32* %dst to i16*
%dst1 = getelementptr inbounds i16, i16* %dst16, i32 1
%x16 = load i16, i16* %dst1
ret i16 %x16
}
; Function Attrs: nounwind
define void @store-pair(i32* %dst, i32 %x, i32 %y) #0 {
%dst01 = bitcast i32* %dst to i32*
%dst1 = getelementptr inbounds i32, i32* %dst, i32 1
store i32 %x, i32* %dst01
store i32 %x, i32* %dst1
ret void
}
attributes #0 = { nounwind }
...
---
name: promote-load-from-store
alignment: 2
exposesReturnsTwice: false
tracksRegLiveness: true
liveins:
- { reg: '%x0' }
- { reg: '%w1' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: false
hasCalls: false
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
body: |
bb.0 (%ir-block.0):
liveins: %w1, %x0, %lr
STRWui killed %w1, %x0, 0 :: (store 4 into %ir.dst)
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
%w0 = LDRHHui killed %x0, 1 :: (load 2 from %ir.dst1)
RET %lr, implicit %w0
...
# CHECK-LABEL: name: promote-load-from-store
# CHECK: STRWui %w1
# CHECK: UBFMWri %w1
---
name: store-pair
alignment: 2
exposesReturnsTwice: false
tracksRegLiveness: true
liveins:
- { reg: '%x0' }
- { reg: '%w1' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: false
hasCalls: false
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
body: |
bb.0 (%ir-block.0):
liveins: %w1, %x0, %lr
STRWui %w1, %x0, 0 :: (store 4 into %ir.dst01)
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
CFI_INSTRUCTION 0
STRWui killed %w1, killed %x0, 1 :: (store 4 into %ir.dst1)
RET %lr
...
# CHECK-LABEL: name: store-pair
# CHECK: STPWi