1 # RUN: llc -start-before=aarch64-ldst-opt -o - %s | FileCheck %s
2 # CHECK-NOT: stp xzr, xzr, [sp], #16
3 # CHECK: add sp, sp, #16
5 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
6 target triple = "aarch64"
8 define hidden i32 @foo(i32 %0) {
9 %2 = alloca [4 x i32], align 4
10 %3 = bitcast ptr %2 to ptr
11 call void @llvm.memset.p0.i64(ptr nonnull align 4 dereferenceable(16) %3, i8 0, i64 16, i1 false)
12 %4 = sext i32 %0 to i64
13 %5 = getelementptr inbounds [4 x i32], ptr %2, i64 0, i64 %4
14 %6 = load i32, ptr %5, align 4
18 declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
19 declare void @llvm.stackprotector(ptr, ptr) #3
21 !llvm.module.flags = !{!0}
24 !0 = !{i32 1, !"wchar_size", i32 4}
25 !1 = !{!"clang version 11.0.0 "}
27 !3 = !{!"int", !4, i64 0}
28 !4 = !{!"omnipotent char", !5, i64 0}
29 !5 = !{!"Simple C++ TBAA"}
35 exposesReturnsTwice: false
37 regBankSelected: false
40 tracksRegLiveness: true
44 - { reg: '$w0', virtual-reg: '' }
46 isFrameAddressTaken: false
47 isReturnAddressTaken: false
57 cvBytesOfCalleeSavedRegisters: 0
58 hasOpaqueSPAdjustment: false
60 hasMustTailInVarArgFunc: false
66 - { id: 0, type: default, offset: -16, size: 16,
67 alignment: 8, stack-id: default, callee-saved-register: '', callee-saved-restored: true,
68 local-offset: -16, debug-info-variable: '', debug-info-expression: '',
69 debug-info-location: '' }
72 machineFunctionInfo: {}
77 $sp = frame-setup SUBXri $sp, 16, 0
78 $x8 = ADDXri $sp, 0, 0
79 STRXui $xzr, $sp, 1 :: (store (s64) into %ir.3 + 8)
80 STRXui $xzr, $sp, 0 :: (store (s64) into %ir.3)
81 renamable $w0 = LDRWroW killed renamable $x8, killed renamable $w0, 1, 1 :: (load (s32) from %ir.5, !tbaa !2)
82 $sp = frame-destroy ADDXri $sp, 16, 0
83 RET undef $lr, implicit $w0