[llvm] [AArch64] Fix using NEON copies in streaming-mode-enable regions. (PR #174738)

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 9 01:54:04 PST 2026


================
@@ -5674,8 +5699,12 @@ void AArch64InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
 
   if (AArch64::FPR128RegClass.contains(DestReg) &&
       AArch64::FPR128RegClass.contains(SrcReg)) {
-    if (Subtarget.isSVEorStreamingSVEAvailable() &&
-        !Subtarget.isNeonAvailable()) {
+    // In streaming regions, NEON is illegal but streaming-SVE is available.
+    // Use SVE for copies if we're in a streaming region and SME is available.
+    // With +sme-fa64, NEON is legal in streaming mode so we can use it.
+    if ((Subtarget.isSVEorStreamingSVEAvailable() &&
+         !Subtarget.isNeonAvailable()) ||
+        (!Subtarget.hasSMEFA64() && isInStreamingCallSiteRegion(MBB, I))) {
----------------
aemerson wrote:

I can fold in hasSMEFA64() but `Subtarget.isNeonAvailable()` won't work for us here because that returns true for our cores even though in this region it's not allowed with just SME.

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


More information about the llvm-commits mailing list