diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/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)); diff --git a/llvm/test/CodeGen/AArch64/sve-streaming-mode-test-register-mov.ll b/llvm/test/CodeGen/AArch64/sve-streaming-mode-test-register-mov.ll new file mode 100644 --- /dev/null +++ b/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" }