1
; RUN: llc < %s -march=arm64 -enable-misched=false -aarch64-stp-suppress=false -verify-machineinstrs | FileCheck %s
3
; The next set of tests makes sure we can combine the second instruction into
6
; CHECK-LABEL: stp_int_aa
7
; CHECK: stp w0, w1, [x2]
8
; CHECK: ldr w0, [x2, #8]
10
define i32 @stp_int_aa(i32 %a, i32 %b, i32* nocapture %p) nounwind {
11
store i32 %a, i32* %p, align 4
12
%ld.ptr = getelementptr inbounds i32, i32* %p, i64 2
13
%tmp = load i32, i32* %ld.ptr, align 4
14
%add.ptr = getelementptr inbounds i32, i32* %p, i64 1
15
store i32 %b, i32* %add.ptr, align 4
19
; CHECK-LABEL: stp_long_aa
20
; CHECK: stp x0, x1, [x2]
21
; CHECK: ldr x0, [x2, #16]
23
define i64 @stp_long_aa(i64 %a, i64 %b, i64* nocapture %p) nounwind {
24
store i64 %a, i64* %p, align 8
25
%ld.ptr = getelementptr inbounds i64, i64* %p, i64 2
26
%tmp = load i64, i64* %ld.ptr, align 4
27
%add.ptr = getelementptr inbounds i64, i64* %p, i64 1
28
store i64 %b, i64* %add.ptr, align 8
32
; CHECK-LABEL: stp_float_aa
33
; CHECK: stp s0, s1, [x0]
34
; CHECK: ldr s0, [x0, #8]
36
define float @stp_float_aa(float %a, float %b, float* nocapture %p) nounwind {
37
store float %a, float* %p, align 4
38
%ld.ptr = getelementptr inbounds float, float* %p, i64 2
39
%tmp = load float, float* %ld.ptr, align 4
40
%add.ptr = getelementptr inbounds float, float* %p, i64 1
41
store float %b, float* %add.ptr, align 4
45
; CHECK-LABEL: stp_double_aa
46
; CHECK: stp d0, d1, [x0]
47
; CHECK: ldr d0, [x0, #16]
49
define double @stp_double_aa(double %a, double %b, double* nocapture %p) nounwind {
50
store double %a, double* %p, align 8
51
%ld.ptr = getelementptr inbounds double, double* %p, i64 2
52
%tmp = load double, double* %ld.ptr, align 4
53
%add.ptr = getelementptr inbounds double, double* %p, i64 1
54
store double %b, double* %add.ptr, align 8
58
; The next set of tests makes sure we can combine the first instruction into
61
; CHECK-LABEL: stp_int_aa_after
62
; CHECK: ldr w0, [x3, #4]
63
; CHECK: stp w1, w2, [x3]
65
define i32 @stp_int_aa_after(i32 %w0, i32 %a, i32 %b, i32* nocapture %p) nounwind {
66
store i32 %a, i32* %p, align 4
67
%ld.ptr = getelementptr inbounds i32, i32* %p, i64 1
68
%tmp = load i32, i32* %ld.ptr, align 4
69
%add.ptr = getelementptr inbounds i32, i32* %p, i64 1
70
store i32 %b, i32* %add.ptr, align 4
74
; CHECK-LABEL: stp_long_aa_after
75
; CHECK: ldr x0, [x3, #8]
76
; CHECK: stp x1, x2, [x3]
78
define i64 @stp_long_aa_after(i64 %x0, i64 %a, i64 %b, i64* nocapture %p) nounwind {
79
store i64 %a, i64* %p, align 8
80
%ld.ptr = getelementptr inbounds i64, i64* %p, i64 1
81
%tmp = load i64, i64* %ld.ptr, align 4
82
%add.ptr = getelementptr inbounds i64, i64* %p, i64 1
83
store i64 %b, i64* %add.ptr, align 8
87
; CHECK-LABEL: stp_float_aa_after
88
; CHECK: ldr s0, [x0, #4]
89
; CHECK: stp s1, s2, [x0]
91
define float @stp_float_aa_after(float %s0, float %a, float %b, float* nocapture %p) nounwind {
92
store float %a, float* %p, align 4
93
%ld.ptr = getelementptr inbounds float, float* %p, i64 1
94
%tmp = load float, float* %ld.ptr, align 4
95
%add.ptr = getelementptr inbounds float, float* %p, i64 1
96
store float %b, float* %add.ptr, align 4
100
; CHECK-LABEL: stp_double_aa_after
101
; CHECK: ldr d0, [x0, #8]
102
; CHECK: stp d1, d2, [x0]
104
define double @stp_double_aa_after(double %d0, double %a, double %b, double* nocapture %p) nounwind {
105
store double %a, double* %p, align 8
106
%ld.ptr = getelementptr inbounds double, double* %p, i64 1
107
%tmp = load double, double* %ld.ptr, align 4
108
%add.ptr = getelementptr inbounds double, double* %p, i64 1
109
store double %b, double* %add.ptr, align 8