[llvm] [AArch64] Avoid streaming mode hazards from FP constant stores (PR #114207)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 07:06:09 PDT 2024


================
@@ -0,0 +1,171 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -aarch64-streaming-hazard-size=64 -force-streaming-compatible -mattr=+sve < %s | FileCheck %s
+; RUN: llc -aarch64-streaming-hazard-size=64 -force-streaming -mattr=+sme < %s | FileCheck %s
+; RUN: llc -force-streaming -mattr=+sme < %s | FileCheck %s --check-prefix=NOHAZARD
+
+target triple = "aarch64-unknown-linux-gnu"
+
+; This test checks that in streaming[-compatible] functions if there could be
+; a hazard between GPR and FPR memory operations, then integer stores are not
+; used for floating-point constants.
+
+define void @"store_f64_0.0"(ptr %num) {
+; CHECK-LABEL: store_f64_0.0:
+; CHECK:       // %bb.0: // %entry
+; CHECK-NEXT:    fmov d0, xzr
+; CHECK-NEXT:    str d0, [x0]
+; CHECK-NEXT:    ret
+;
+; NOHAZARD-LABEL: store_f64_0.0:
+; NOHAZARD:       // %bb.0: // %entry
+; NOHAZARD-NEXT:    str xzr, [x0]
+; NOHAZARD-NEXT:    ret
+entry:
+  store double 0.000000e+00, ptr %num, align 8
----------------
MacDue wrote:

Sure, added a `store_i64_0` test case :+1: 

https://github.com/llvm/llvm-project/pull/114207


More information about the llvm-commits mailing list