Skip to content

Commit 5b28083

Browse files
committed
Fixups
1 parent 500090b commit 5b28083

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22514,20 +22514,18 @@ static SDValue performSTNT1Combine(SDNode *N, SelectionDAG &DAG) {
2251422514
/// movi v0.2d, #0
2251522515
/// str q0, [x0]
2251622516
///
22517-
static SDValue replaceZeroVectorStore(SelectionDAG &DAG, StoreSDNode &St,
22518-
AArch64Subtarget const &Subtarget) {
22517+
static SDValue replaceZeroVectorStore(SelectionDAG &DAG, StoreSDNode &St) {
2251922518
SDValue StVal = St.getValue();
2252022519
EVT VT = StVal.getValueType();
2252122520

2252222521
// Avoid scalarizing zero splat stores for scalable vectors.
2252322522
if (VT.isScalableVector())
2252422523
return SDValue();
2252522524

22526-
// Do not replace the FP store when it could result in a streaming memory
22525+
// Do not replace the vector store when it could result in a streaming memory
2252722526
// hazard.
22528-
if (VT.getVectorElementType().isFloatingPoint() &&
22529-
Subtarget.getStreamingHazardSize() > 0 &&
22530-
(Subtarget.isStreaming() || Subtarget.isStreamingCompatible()))
22527+
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
22528+
if (!TLI.canUseIntLoadStoreForFloatValues())
2253122529
return SDValue();
2253222530

2253322531
// It is beneficial to scalarize a zero splat store for 2 or 3 i64 elements or
@@ -22659,7 +22657,7 @@ static SDValue splitStores(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
2265922657
// If we get a splat of zeros, convert this vector store to a store of
2266022658
// scalars. They will be merged into store pairs of xzr thereby removing one
2266122659
// instruction and one register.
22662-
if (SDValue ReplacedZeroSplat = replaceZeroVectorStore(DAG, *S, *Subtarget))
22660+
if (SDValue ReplacedZeroSplat = replaceZeroVectorStore(DAG, *S))
2266322661
return ReplacedZeroSplat;
2266422662

2266522663
// FIXME: The logic for deciding if an unaligned store should be split should

llvm/test/CodeGen/AArch64/sve-streaming-mode-fp-constant-stores.ll

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ entry:
2525
ret void
2626
}
2727

28+
; (Integer types still use GPR stores)
29+
define void @store_i64_0(ptr %num) {
30+
; CHECK-LABEL: store_i64_0:
31+
; CHECK: // %bb.0:
32+
; CHECK-NEXT: str xzr, [x0]
33+
; CHECK-NEXT: ret
34+
;
35+
; NOHAZARD-LABEL: store_i64_0:
36+
; NOHAZARD: // %bb.0:
37+
; NOHAZARD-NEXT: str xzr, [x0]
38+
; NOHAZARD-NEXT: ret
39+
store i64 0, ptr %num, align 8
40+
ret void
41+
}
42+
2843
define void @"store_f64_1.0"(ptr %num) {
2944
; CHECK-LABEL: store_f64_1.0:
3045
; CHECK: // %bb.0: // %entry
@@ -45,8 +60,8 @@ entry:
4560
define void @"store_f64_1.23456789"(ptr %num) {
4661
; CHECK-LABEL: store_f64_1.23456789:
4762
; CHECK: // %bb.0: // %entry
48-
; CHECK-NEXT: adrp x8, .LCPI2_0
49-
; CHECK-NEXT: ldr d0, [x8, :lo12:.LCPI2_0]
63+
; CHECK-NEXT: adrp x8, .LCPI3_0
64+
; CHECK-NEXT: ldr d0, [x8, :lo12:.LCPI3_0]
5065
; CHECK-NEXT: str d0, [x0]
5166
; CHECK-NEXT: ret
5267
;

0 commit comments

Comments
 (0)