[clang] [llvm] [LLVMABI][AARCH64] Implement general aggregate classification (PR #230631)
Madhur Amilkanthwar via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 11 21:02:22 PDT 2026
================
@@ -151,8 +159,31 @@ ArgInfo AArch64TargetInfo::classifyReturnType(const Type *RetTy,
NPRN);
}
- reportNYI("Aggregate return type handling");
- return ArgInfo::getIgnore();
+ // Aggregates of at most 16 bytes are returned directly in registers or on
+ // the stack.
+ if (Size <= 128) {
+ if (Size <= 64 && !Opts.IsBigEndian) {
+ // A little-endian aggregate of at most 8 bytes is an integer of its
+ // exact width. A big-endian aggregate is widened to a multiple of 8
+ // bytes so that it occupies the high bits of the register.
----------------
madhur13490 wrote:
This comment talks about big-endian but sits inside the little-endian branch. Clang's version also explains why BE has to widen (otherwise a composite looks the same as a plain integer, which always lives in the low bits). It'd be nice to keep that and move the comment above the if.
https://github.com/llvm/llvm-project/pull/230631
More information about the llvm-commits
mailing list