diff options
author | Alex Bradbury <asb@igalia.com> | 2023-08-07 10:42:45 +0100 |
---|---|---|
committer | Alex Bradbury <asb@igalia.com> | 2023-08-07 10:45:22 +0100 |
commit | e3c57fdd8439ba82c67347629a3c66f293e1f3d0 (patch) | |
tree | ba4026d5a50b2fa7646857bff5803cb0be98bcf3 /llvm/lib/Transforms/IPO/FunctionSpecialization.cpp | |
parent | 91a0e832d42abc2890d4f8871a14003de6a9919e (diff) | |
download | llvm-e3c57fdd8439ba82c67347629a3c66f293e1f3d0.zip llvm-e3c57fdd8439ba82c67347629a3c66f293e1f3d0.tar.gz llvm-e3c57fdd8439ba82c67347629a3c66f293e1f3d0.tar.bz2 |
[clang][RISCV] Fix bug in ABI handling of empty structs with hard FP calling conventions in C++
As reported in <https://github.com/llvm/llvm-project/issues/58929>,
Clang's handling of empty structs in the case of small structs that may
be eligible to be passed using the hard FP calling convention doesn't
match g++. In general, C++ record fields are never empty unless
[[no_unique_address]] is used, but the RISC-V FP ABI overrides this.
After this patch, fields of structs that contain empty records will be
ignored, even in C++, when considering eligibility for the FP calling
convention ('flattening'). It isn't explicitly noted in the RISC-V
psABI, but arrays of empty records will disqualify a struct for
consideration of using the FP calling convention in g++. This patch
matches that behaviour. The psABI issue
<https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/358> seeks
to clarify this.
This patch was previously committed but reverted after a bug was found.
This recommit adds additional logic to prevent that bug (adding an extra
check for when a candidate from detectFPCCEligibleStructHelper may not
be valid).
Differential Revision: https://reviews.llvm.org/D142327
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionSpecialization.cpp')
0 files changed, 0 insertions, 0 deletions