Skip to content

Commit 6919b9e

Browse files
committed
Add Aarch64 ldst-opt test.
llvm-svn: 305951
1 parent cae6254 commit 6919b9e

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

llvm/test/CodeGen/AArch64/ldst-opt.ll

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,3 +1608,63 @@ entry:
16081608
store <4 x double> zeroinitializer, <4 x double>* %p
16091609
ret void
16101610
}
1611+
1612+
; Verify that non-consecutive merges do not generate q0
1613+
define void @merge_multiple_128bit_stores(i64* %p) {
1614+
; CHECK-LABEL: merge_multiple_128bit_stores
1615+
; CHECK: // %entry
1616+
; NOSTRICTALIGN-NEXT: movi v[[REG:[0-9]]].2d, #0000000000000000
1617+
; NOSTRICTALIGN-NEXT: str q0, [x0]
1618+
; NOSTRICTALIGN-NEXT: stur q0, [x0, #24]
1619+
; NOSTRICTALIGN-NEXT: str q0, [x0, #48]
1620+
; STRICTALIGN-NEXT: stp xzr, xzr, [x0]
1621+
; STRICTALIGN-NEXT: stp xzr, xzr, [x0, #24]
1622+
; STRICTALIGN-NEXT: stp xzr, xzr, [x0, #48]
1623+
; CHECK-NEXT: ret
1624+
entry:
1625+
store i64 0, i64* %p
1626+
%p1 = getelementptr i64, i64* %p, i64 1
1627+
store i64 0, i64* %p1
1628+
%p3 = getelementptr i64, i64* %p, i64 3
1629+
store i64 0, i64* %p3
1630+
%p4 = getelementptr i64, i64* %p, i64 4
1631+
store i64 0, i64* %p4
1632+
%p6 = getelementptr i64, i64* %p, i64 6
1633+
store i64 0, i64* %p6
1634+
%p7 = getelementptr i64, i64* %p, i64 7
1635+
store i64 0, i64* %p7
1636+
ret void
1637+
}
1638+
1639+
; Verify that large stores generate stp q
1640+
define void @merge_multiple_128bit_stores_consec(i64* %p) {
1641+
; CHECK-LABEL: merge_multiple_128bit_stores_consec
1642+
; CHECK: // %entry
1643+
; NOSTRICTALIGN-NEXT: movi v[[REG:[0-9]]].2d, #0000000000000000
1644+
; NOSTRICTALIGN-NEXT: stp q[[REG]], q[[REG]], [x{{[0-9]+}}]
1645+
; NOSTRICTALIGN-NEXT: stp q[[REG]], q[[REG]], [x{{[0-9]+}}, #32]
1646+
; STRICTALIGN-NEXT: stp xzr, xzr, [x0]
1647+
; STRICTALIGN-NEXT: stp xzr, xzr, [x0, #16]
1648+
; STRICTALIGN-NEXT: stp xzr, xzr, [x0, #32]
1649+
; STRICTALIGN-NEXT: stp xzr, xzr, [x0, #48]
1650+
; CHECK-NEXT: ret
1651+
entry:
1652+
store i64 0, i64* %p
1653+
%p1 = getelementptr i64, i64* %p, i64 1
1654+
store i64 0, i64* %p1
1655+
%p2 = getelementptr i64, i64* %p, i64 2
1656+
store i64 0, i64* %p2
1657+
%p3 = getelementptr i64, i64* %p, i64 3
1658+
store i64 0, i64* %p3
1659+
%p4 = getelementptr i64, i64* %p, i64 4
1660+
store i64 0, i64* %p4
1661+
%p5 = getelementptr i64, i64* %p, i64 5
1662+
store i64 0, i64* %p5
1663+
%p6 = getelementptr i64, i64* %p, i64 6
1664+
store i64 0, i64* %p6
1665+
%p7 = getelementptr i64, i64* %p, i64 7
1666+
store i64 0, i64* %p7
1667+
ret void
1668+
}
1669+
1670+

0 commit comments

Comments
 (0)