[PATCH] D138211: [AArch64][SME]: Use SVE mov instruction for FPR128 registers in streaming-compatible mode.

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 03:43:44 PST 2022


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd8306b88855d: [AArch64][SME]: Use SVE mov instruction for FPR128 registers in streaming… (authored by Hassnaa Hamdi <hassnaa.hamdi at arm.com>).

Changed prior to commit:
  https://reviews.llvm.org/D138211?vs=476162&id=476415#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138211/new/

https://reviews.llvm.org/D138211

Files:
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/test/CodeGen/AArch64/sve-streaming-mode-test-register-mov.ll


Index: llvm/test/CodeGen/AArch64/sve-streaming-mode-test-register-mov.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AArch64/sve-streaming-mode-test-register-mov.ll
@@ -0,0 +1,15 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -force-streaming-compatible-sve  < %s | FileCheck %s
+
+target triple = "aarch64-unknown-linux-gnu"
+
+; A NEON Q-register mov is not valid in streaming mode, but an SVE Z-register mov is.
+define fp128 @test_streaming_compatible_register_mov(fp128 %q0, fp128 %q1) #0 {
+; CHECK-LABEL: test_streaming_compatible_register_mov:
+; CHECK:       // %bb.0:
+; CHECK-NEXT:    mov z0.d, z1.d
+; CHECK-NEXT:    ret
+  ret fp128 %q1
+}
+
+attributes #0 = { "target-features"="+sve" }
Index: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -3687,7 +3687,12 @@
 
   if (AArch64::FPR128RegClass.contains(DestReg) &&
       AArch64::FPR128RegClass.contains(SrcReg)) {
-    if (Subtarget.hasNEON()) {
+    if (Subtarget.forceStreamingCompatibleSVE()) {
+      BuildMI(MBB, I, DL, get(AArch64::ORR_ZZZ))
+          .addReg(AArch64::Z0 + (DestReg - AArch64::Q0), RegState::Define)
+          .addReg(AArch64::Z0 + (SrcReg - AArch64::Q0))
+          .addReg(AArch64::Z0 + (SrcReg - AArch64::Q0));
+    } else if (Subtarget.hasNEON()) {
       BuildMI(MBB, I, DL, get(AArch64::ORRv16i8), DestReg)
           .addReg(SrcReg)
           .addReg(SrcReg, getKillRegState(KillSrc));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138211.476415.patch
Type: text/x-patch
Size: 1659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221118/0a0316d2/attachment.bin>


More information about the llvm-commits mailing list