diff options
| author | Momchil Velikov <momchil.velikov@arm.com> | 2024-10-28 15:43:14 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-28 15:43:14 +0000 |
| commit | 53f7f8eccabd6e3383edfeec312bf8671a89bc66 (patch) | |
| tree | c697b43934e866712ee08dfa09b7818cc898ab31 /llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp | |
| parent | 7d1e98c7d34e2f4be1812a2f00f1d0464f29e542 (diff) | |
[Clang][AArch64] Fix Pure Scalables Types argument passing and return (#112747)
Pure Scalable Types are defined in AAPCS64 here:
https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#pure-scalable-types-psts
And should be passed according to Rule C.7 here:
https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#682parameter-passing-rules
This part of the ABI is completely unimplemented in Clang, instead it
treats PSTs sometimes as HFAs/HVAs, sometime as general composite types.
This patch implements the rules for passing PSTs by employing the
`CoerceAndExpand` method and extending it to:
* allow array types in the `coerceToType`; Now only `[N x i8]` are
considered padding.
* allow mismatch between the elements of the `coerceToType` and the
elements of the `unpaddedCoerceToType`; AArch64 uses this to map
fixed-length vector types to SVE vector types.
Corectly passing a PST argument needs a decision in Clang about whether
to pass it in memory or registers or, equivalently, whether to use the
`Indirect` or `Expand/CoerceAndExpand` method. It was considered
relatively harder (or not practically possible) to make that decision in
the AArch64 backend.
Hence this patch implements the register counting from AAPCS64 (cf.
`NSRN`, `NPRN`) to guide the Clang's decision.
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp')
0 files changed, 0 insertions, 0 deletions
