xref: /aosp_15_r20/external/llvm/test/CodeGen/AArch64/aarch64-stp-cluster.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; REQUIRES: asserts
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=arm64-linux-gnu -mcpu=cortex-a57 -verify-misched -debug-only=misched -aarch64-stp-suppress=false -o - 2>&1 > /dev/null | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; CHECK: ********** MI Scheduling **********
5*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: stp_i64_scale:BB#0
6*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(4) - SU(3)
7*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(2) - SU(5)
8*9880d681SAndroid Build Coastguard Worker; CHECK:SU(4):   STRXui %vreg1, %vreg0, 1
9*9880d681SAndroid Build Coastguard Worker; CHECK:SU(3):   STRXui %vreg1, %vreg0, 2
10*9880d681SAndroid Build Coastguard Worker; CHECK:SU(2):   STRXui %vreg1, %vreg0, 3
11*9880d681SAndroid Build Coastguard Worker; CHECK:SU(5):   STRXui %vreg1, %vreg0, 4
12*9880d681SAndroid Build Coastguard Workerdefine i64 @stp_i64_scale(i64* nocapture %P, i64 %v) {
13*9880d681SAndroid Build Coastguard Workerentry:
14*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds i64, i64* %P, i64 3
15*9880d681SAndroid Build Coastguard Worker  store i64 %v, i64* %arrayidx
16*9880d681SAndroid Build Coastguard Worker  %arrayidx1 = getelementptr inbounds i64, i64* %P, i64 2
17*9880d681SAndroid Build Coastguard Worker  store i64 %v, i64* %arrayidx1
18*9880d681SAndroid Build Coastguard Worker  %arrayidx2 = getelementptr inbounds i64, i64* %P, i64 1
19*9880d681SAndroid Build Coastguard Worker  store i64 %v, i64* %arrayidx2
20*9880d681SAndroid Build Coastguard Worker  %arrayidx3 = getelementptr inbounds i64, i64* %P, i64 4
21*9880d681SAndroid Build Coastguard Worker  store i64 %v, i64* %arrayidx3
22*9880d681SAndroid Build Coastguard Worker  ret i64 %v
23*9880d681SAndroid Build Coastguard Worker}
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Worker; CHECK: ********** MI Scheduling **********
26*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: stp_i32_scale:BB#0
27*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(4) - SU(3)
28*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(2) - SU(5)
29*9880d681SAndroid Build Coastguard Worker; CHECK:SU(4):   STRWui %vreg1, %vreg0, 1
30*9880d681SAndroid Build Coastguard Worker; CHECK:SU(3):   STRWui %vreg1, %vreg0, 2
31*9880d681SAndroid Build Coastguard Worker; CHECK:SU(2):   STRWui %vreg1, %vreg0, 3
32*9880d681SAndroid Build Coastguard Worker; CHECK:SU(5):   STRWui %vreg1, %vreg0, 4
33*9880d681SAndroid Build Coastguard Workerdefine i32 @stp_i32_scale(i32* nocapture %P, i32 %v) {
34*9880d681SAndroid Build Coastguard Workerentry:
35*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds i32, i32* %P, i32 3
36*9880d681SAndroid Build Coastguard Worker  store i32 %v, i32* %arrayidx
37*9880d681SAndroid Build Coastguard Worker  %arrayidx1 = getelementptr inbounds i32, i32* %P, i32 2
38*9880d681SAndroid Build Coastguard Worker  store i32 %v, i32* %arrayidx1
39*9880d681SAndroid Build Coastguard Worker  %arrayidx2 = getelementptr inbounds i32, i32* %P, i32 1
40*9880d681SAndroid Build Coastguard Worker  store i32 %v, i32* %arrayidx2
41*9880d681SAndroid Build Coastguard Worker  %arrayidx3 = getelementptr inbounds i32, i32* %P, i32 4
42*9880d681SAndroid Build Coastguard Worker  store i32 %v, i32* %arrayidx3
43*9880d681SAndroid Build Coastguard Worker  ret i32 %v
44*9880d681SAndroid Build Coastguard Worker}
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Worker; CHECK:********** MI Scheduling **********
47*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL:stp_i64_unscale:BB#0 entry
48*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(5) - SU(2)
49*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(4) - SU(3)
50*9880d681SAndroid Build Coastguard Worker; CHECK:SU(5):   STURXi %vreg1, %vreg0, -32
51*9880d681SAndroid Build Coastguard Worker; CHECK:SU(2):   STURXi %vreg1, %vreg0, -24
52*9880d681SAndroid Build Coastguard Worker; CHECK:SU(4):   STURXi %vreg1, %vreg0, -16
53*9880d681SAndroid Build Coastguard Worker; CHECK:SU(3):   STURXi %vreg1, %vreg0, -8
54*9880d681SAndroid Build Coastguard Workerdefine void @stp_i64_unscale(i64* nocapture %P, i64 %v) #0 {
55*9880d681SAndroid Build Coastguard Workerentry:
56*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds i64, i64* %P, i64 -3
57*9880d681SAndroid Build Coastguard Worker  store i64 %v, i64* %arrayidx
58*9880d681SAndroid Build Coastguard Worker  %arrayidx1 = getelementptr inbounds i64, i64* %P, i64 -1
59*9880d681SAndroid Build Coastguard Worker  store i64 %v, i64* %arrayidx1
60*9880d681SAndroid Build Coastguard Worker  %arrayidx2 = getelementptr inbounds i64, i64* %P, i64 -2
61*9880d681SAndroid Build Coastguard Worker  store i64 %v, i64* %arrayidx2
62*9880d681SAndroid Build Coastguard Worker  %arrayidx3 = getelementptr inbounds i64, i64* %P, i64 -4
63*9880d681SAndroid Build Coastguard Worker  store i64 %v, i64* %arrayidx3
64*9880d681SAndroid Build Coastguard Worker  ret void
65*9880d681SAndroid Build Coastguard Worker}
66*9880d681SAndroid Build Coastguard Worker
67*9880d681SAndroid Build Coastguard Worker; CHECK:********** MI Scheduling **********
68*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL:stp_i32_unscale:BB#0 entry
69*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(5) - SU(2)
70*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(4) - SU(3)
71*9880d681SAndroid Build Coastguard Worker; CHECK:SU(5):   STURWi %vreg1, %vreg0, -16
72*9880d681SAndroid Build Coastguard Worker; CHECK:SU(2):   STURWi %vreg1, %vreg0, -12
73*9880d681SAndroid Build Coastguard Worker; CHECK:SU(4):   STURWi %vreg1, %vreg0, -8
74*9880d681SAndroid Build Coastguard Worker; CHECK:SU(3):   STURWi %vreg1, %vreg0, -4
75*9880d681SAndroid Build Coastguard Workerdefine void @stp_i32_unscale(i32* nocapture %P, i32 %v) #0 {
76*9880d681SAndroid Build Coastguard Workerentry:
77*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds i32, i32* %P, i32 -3
78*9880d681SAndroid Build Coastguard Worker  store i32 %v, i32* %arrayidx
79*9880d681SAndroid Build Coastguard Worker  %arrayidx1 = getelementptr inbounds i32, i32* %P, i32 -1
80*9880d681SAndroid Build Coastguard Worker  store i32 %v, i32* %arrayidx1
81*9880d681SAndroid Build Coastguard Worker  %arrayidx2 = getelementptr inbounds i32, i32* %P, i32 -2
82*9880d681SAndroid Build Coastguard Worker  store i32 %v, i32* %arrayidx2
83*9880d681SAndroid Build Coastguard Worker  %arrayidx3 = getelementptr inbounds i32, i32* %P, i32 -4
84*9880d681SAndroid Build Coastguard Worker  store i32 %v, i32* %arrayidx3
85*9880d681SAndroid Build Coastguard Worker  ret void
86*9880d681SAndroid Build Coastguard Worker}
87*9880d681SAndroid Build Coastguard Worker
88*9880d681SAndroid Build Coastguard Worker; CHECK:********** MI Scheduling **********
89*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL:stp_double:BB#0
90*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(3) - SU(4)
91*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(2) - SU(5)
92*9880d681SAndroid Build Coastguard Worker; CHECK:SU(3):   STRDui %vreg1, %vreg0, 1
93*9880d681SAndroid Build Coastguard Worker; CHECK:SU(4):   STRDui %vreg1, %vreg0, 2
94*9880d681SAndroid Build Coastguard Worker; CHECK:SU(2):   STRDui %vreg1, %vreg0, 3
95*9880d681SAndroid Build Coastguard Worker; CHECK:SU(5):   STRDui %vreg1, %vreg0, 4
96*9880d681SAndroid Build Coastguard Workerdefine void @stp_double(double* nocapture %P, double %v)  {
97*9880d681SAndroid Build Coastguard Workerentry:
98*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds double, double* %P, i64 3
99*9880d681SAndroid Build Coastguard Worker  store double %v, double* %arrayidx
100*9880d681SAndroid Build Coastguard Worker  %arrayidx1 = getelementptr inbounds double, double* %P, i64 1
101*9880d681SAndroid Build Coastguard Worker  store double %v, double* %arrayidx1
102*9880d681SAndroid Build Coastguard Worker  %arrayidx2 = getelementptr inbounds double, double* %P, i64 2
103*9880d681SAndroid Build Coastguard Worker  store double %v, double* %arrayidx2
104*9880d681SAndroid Build Coastguard Worker  %arrayidx3 = getelementptr inbounds double, double* %P, i64 4
105*9880d681SAndroid Build Coastguard Worker  store double %v, double* %arrayidx3
106*9880d681SAndroid Build Coastguard Worker  ret void
107*9880d681SAndroid Build Coastguard Worker}
108*9880d681SAndroid Build Coastguard Worker
109*9880d681SAndroid Build Coastguard Worker; CHECK:********** MI Scheduling **********
110*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL:stp_float:BB#0
111*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(3) - SU(4)
112*9880d681SAndroid Build Coastguard Worker; CHECK:Cluster ld/st SU(2) - SU(5)
113*9880d681SAndroid Build Coastguard Worker; CHECK:SU(3):   STRSui %vreg1, %vreg0, 1
114*9880d681SAndroid Build Coastguard Worker; CHECK:SU(4):   STRSui %vreg1, %vreg0, 2
115*9880d681SAndroid Build Coastguard Worker; CHECK:SU(2):   STRSui %vreg1, %vreg0, 3
116*9880d681SAndroid Build Coastguard Worker; CHECK:SU(5):   STRSui %vreg1, %vreg0, 4
117*9880d681SAndroid Build Coastguard Workerdefine void @stp_float(float* nocapture %P, float %v)  {
118*9880d681SAndroid Build Coastguard Workerentry:
119*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds float, float* %P, i64 3
120*9880d681SAndroid Build Coastguard Worker  store float %v, float* %arrayidx
121*9880d681SAndroid Build Coastguard Worker  %arrayidx1 = getelementptr inbounds float, float* %P, i64 1
122*9880d681SAndroid Build Coastguard Worker  store float %v, float* %arrayidx1
123*9880d681SAndroid Build Coastguard Worker  %arrayidx2 = getelementptr inbounds float, float* %P, i64 2
124*9880d681SAndroid Build Coastguard Worker  store float %v, float* %arrayidx2
125*9880d681SAndroid Build Coastguard Worker  %arrayidx3 = getelementptr inbounds float, float* %P, i64 4
126*9880d681SAndroid Build Coastguard Worker  store float %v, float* %arrayidx3
127*9880d681SAndroid Build Coastguard Worker  ret void
128*9880d681SAndroid Build Coastguard Worker}
129*9880d681SAndroid Build Coastguard Worker
130*9880d681SAndroid Build Coastguard Worker; CHECK: ********** MI Scheduling **********
131*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: stp_volatile:BB#0
132*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: Cluster ld/st
133*9880d681SAndroid Build Coastguard Worker; CHECK:SU(2):   STRXui %vreg1, %vreg0, 3; mem:Volatile
134*9880d681SAndroid Build Coastguard Worker; CHECK:SU(3):   STRXui %vreg1, %vreg0, 2; mem:Volatile
135*9880d681SAndroid Build Coastguard Worker; CHECK:SU(4):   STRXui %vreg1, %vreg0, 1; mem:Volatile
136*9880d681SAndroid Build Coastguard Worker; CHECK:SU(5):   STRXui %vreg1, %vreg0, 4; mem:Volatile
137*9880d681SAndroid Build Coastguard Workerdefine i64 @stp_volatile(i64* nocapture %P, i64 %v) {
138*9880d681SAndroid Build Coastguard Workerentry:
139*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds i64, i64* %P, i64 3
140*9880d681SAndroid Build Coastguard Worker  store volatile i64 %v, i64* %arrayidx
141*9880d681SAndroid Build Coastguard Worker  %arrayidx1 = getelementptr inbounds i64, i64* %P, i64 2
142*9880d681SAndroid Build Coastguard Worker  store volatile i64 %v, i64* %arrayidx1
143*9880d681SAndroid Build Coastguard Worker  %arrayidx2 = getelementptr inbounds i64, i64* %P, i64 1
144*9880d681SAndroid Build Coastguard Worker  store volatile i64 %v, i64* %arrayidx2
145*9880d681SAndroid Build Coastguard Worker  %arrayidx3 = getelementptr inbounds i64, i64* %P, i64 4
146*9880d681SAndroid Build Coastguard Worker  store volatile i64 %v, i64* %arrayidx3
147*9880d681SAndroid Build Coastguard Worker  ret i64 %v
148*9880d681SAndroid Build Coastguard Worker}
149*9880d681SAndroid Build Coastguard Worker
150