[llvm-branch-commits] [clang] [llvm] [Clang][CodeGen] Add support for _Complex inline asm register operands (PR #236695)

Bill Wendling via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Nov 5 00:00:50 PST 2026


================
@@ -2555,7 +2555,7 @@ std::pair<llvm::Value*, llvm::Type *> CodeGenFunction::EmitAsmInputLValue(
 
     llvm::Type *Ty = ConvertType(InputType);
     uint64_t Size = CGM.getDataLayout().getTypeSizeInBits(Ty);
-    if ((Size <= 64 && llvm::isPowerOf2_64(Size)) ||
+    if ((Size <= 128 && llvm::isPowerOf2_64(Size)) ||
----------------
isanbard wrote:

So I had Claude take a gander. There were issues with AArch64 and PowerPC that are now solved. Here's the reply it came up with:

> 128 is the largest aggregate SelectionDAG turns into an integer for an asm operand (ParseConstraints tiles 1/8/16/32/64/128 bits). Checking i128 `"r"` across targets turned up AArch64 and PPC64 using two 32-bit registers and dropping half the value; #239127 and #239128, earlier in this stack, fix that. Elsewhere it's two 64-bit registers, four 32-bit ones, a register pair (SystemZ), or a clean "could not allocate input reg" error (MIPS, Hexagon). The cap now also applies only to register-only and tied inputs; `"rm"`/`"g"` inputs keep passing their address.

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


More information about the llvm-branch-commits mailing list