[llvm] [AArch64] fix copy from GPR32 to FPR16 (PR #176594)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 22 06:29:45 PST 2026


================
@@ -408,13 +408,33 @@ bool InlineAsmLowering::lowerInlineAsm(
         ArrayRef<Register> SrcRegs = GetOrCreateVRegs(*OpInfo.CallOperandVal);
         assert(SrcRegs.size() == 1 && "Single register is expected here");
 
-        // When Def is physreg: use given input.
+        // We need the tied input to live in the same register class as the def.
+        //
+        // - if Def is a vreg, we can just use its regclass.
+        // - if Def is a physreg, create a vreg in the minimal regclass for that
+        //   physreg.
+        //
+        // Otherwise RegBankSelect may leave it in the wrong bank (e.g. GPR even
+        // though it's tied to an FP physreg).
         Register In = SrcRegs[0];
-        // When Def is vreg: copy input to new vreg with same reg class as Def.
+        const TargetRegisterClass *RC;
----------------
arsenm wrote:

Initialize RC from ternary operator 

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


More information about the llvm-commits mailing list