[PATCH] D155432: [AArch64][SME] Use `fmov` instead of NEON `movi` for FP value.
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 24 01:49:47 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6865fbd3da94: [AArch64][SME] Use `fmov` instead of NEON `movi` for FP value. (authored by sdesmalen).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155432/new/
https://reviews.llvm.org/D155432
Files:
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-stores.ll
llvm/test/CodeGen/AArch64/sve-streaming-mode-test-register-mov.ll
Index: llvm/test/CodeGen/AArch64/sve-streaming-mode-test-register-mov.ll
===================================================================
--- llvm/test/CodeGen/AArch64/sve-streaming-mode-test-register-mov.ll
+++ llvm/test/CodeGen/AArch64/sve-streaming-mode-test-register-mov.ll
@@ -12,4 +12,31 @@
ret fp128 %q1
}
+; Test that `movi` isn't used (invalid in streaming mode), but fmov or SVE mov instead.
+define double @fp_zero_constant() #0 {
+; CHECK-LABEL: fp_zero_constant:
+; CHECK: // %bb.0:
+; CHECK-NEXT: fmov d0, xzr
+; CHECK-NEXT: ret
+ ret double 0.0
+}
+
+define <2 x i64> @fixed_vec_zero_constant() #0 {
+; CHECK-LABEL: fixed_vec_zero_constant:
+; CHECK: // %bb.0:
+; CHECK-NEXT: mov z0.d, #0 // =0x0
+; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
+; CHECK-NEXT: ret
+ ret <2 x i64> zeroinitializer
+}
+
+define <2 x double> @fixed_vec_fp_zero_constant() #0 {
+; CHECK-LABEL: fixed_vec_fp_zero_constant:
+; CHECK: // %bb.0:
+; CHECK-NEXT: mov z0.d, #0 // =0x0
+; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
+; CHECK-NEXT: ret
+ ret <2 x double> <double 0.0, double 0.0>
+}
+
attributes #0 = { "target-features"="+sve" }
Index: llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-stores.ll
===================================================================
--- llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-stores.ll
+++ llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-stores.ll
@@ -195,7 +195,7 @@
define void @store_v1f64(ptr %a) #0 {
; CHECK-LABEL: store_v1f64:
; CHECK: // %bb.0:
-; CHECK-NEXT: movi d0, #0000000000000000
+; CHECK-NEXT: fmov d0, xzr
; CHECK-NEXT: str d0, [x0]
; CHECK-NEXT: ret
store <1 x double> zeroinitializer, ptr %a
Index: llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1330,7 +1330,7 @@
void AArch64AsmPrinter::emitFMov0(const MachineInstr &MI) {
Register DestReg = MI.getOperand(0).getReg();
if (STI->hasZeroCycleZeroingFP() && !STI->hasZeroCycleZeroingFPWorkaround() &&
- STI->hasNEON()) {
+ STI->isNeonAvailable()) {
// Convert H/S register to corresponding D register
if (AArch64::H0 <= DestReg && DestReg <= AArch64::H31)
DestReg = AArch64::D0 + (DestReg - AArch64::H0);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155432.543416.patch
Type: text/x-patch
Size: 2442 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230724/c7a5e2a9/attachment.bin>
More information about the llvm-commits
mailing list