[llvm] [CodeGen] Refactor and document ThunkInserter (PR #97468)
Anatoly Trosinenko via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 4 05:07:47 PDT 2024
================
@@ -183,15 +183,13 @@ static const struct ThunkNameAndReg {
namespace {
struct SLSBLRThunkInserter : ThunkInserter<SLSBLRThunkInserter> {
const char *getThunkPrefix() { return SLSBLRNamePrefix; }
- bool mayUseThunk(const MachineFunction &MF, bool InsertedThunks) {
- if (InsertedThunks)
- return false;
+ bool mayUseThunk(const MachineFunction &MF) {
+ // FIXME: ComdatThunks is only accumulated until the first thunk is created.
----------------
atrosinenko wrote:
> IIRC, based on the rationale given on https://reviews.llvm.org/D100546, the no-comdat functionality was needed for projects where the target environment does not support comdat functions.
IIUC comdat thunks are not supported on MachO targets, for example.
> Maybe it makes more sense to assert on when different nocomdat settings on different MachineFunctions would be observed rather than silently producing incorrect code
Sounds reasonable, updated the PR, thanks.
https://github.com/llvm/llvm-project/pull/97468
More information about the llvm-commits
mailing list