[llvm] [AArch64] Inline asm v0-v31 are scalar when having less than 64-bit capacity (PR #169930)

Alexey Merzlyakov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 19 00:25:17 PST 2026


================
@@ -13362,12 +13362,28 @@ AArch64TargetLowering::getRegForInlineAsmConstraint(
       int RegNo;
       bool Failed = Constraint.slice(2, Size - 1).getAsInteger(10, RegNo);
       if (!Failed && RegNo >= 0 && RegNo <= 31) {
-        // v0 - v31 are aliases of q0 - q31 or d0 - d31 depending on size.
+        // v0 - v31 are aliases of q0/d0/s0/h0 - ...31 depending on size.
         // By default we'll emit v0-v31 for this unless there's a modifier where
         // we'll emit the correct register as well.
-        if (VT != MVT::Other && VT.getSizeInBits() <= 64) {
-          Res.first = AArch64::FPR64RegClass.getRegister(RegNo);
-          Res.second = &AArch64::FPR64RegClass;
+        if (VT != MVT::Other) {
+          switch (VT.getSizeInBits()) {
+          default:
----------------
AlexeyMerzlyakov wrote:

OK, switched to return null-pointer in non-supported default cases yet, so it will cause "couldn't allocate output register" error message. Agree, as this way might be better than trying to generate incorrect code for that cases.

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


More information about the llvm-commits mailing list