[llvm] [AArch64][SVE] Support copy of PPR2 register class in copyPhysReg (PR #216303)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 14 05:23:48 PDT 2026


================
@@ -5991,6 +5993,16 @@ void AArch64InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
     return;
   }
 
+  if (AArch64::PPR2RegClass.contains(DestReg) &&
+      AArch64::PPR2RegClass.contains(SrcReg)) {
+    assert(Subtarget.isSVEorStreamingSVEAvailable() &&
+           "Unexpected SVE predicate register.");
+    static const unsigned Indices[] = {AArch64::psub0, AArch64::psub1};
+    copyPhysRegTuple(MBB, I, DL, DestReg, SrcReg, KillSrc, AArch64::ORR_PPzPP,
----------------
sdesmalen-arm wrote:

`forwardCopyWillClobberTuple` considers 32 the maximum number of registers, but for predicates it is 16, so this goes wrong when copying `$p15_p0 to $p0_p1`, for example.

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


More information about the llvm-commits mailing list