[Openmp-commits] [openmp] [NFC][OpenMP][OMPX] Use `[[clang::always_inline]]` instead of `inline` (PR #91294)
Joseph Huber via Openmp-commits
openmp-commits at lists.llvm.org
Thu May 23 07:42:25 PDT 2024
jhuber6 wrote:
> > Why do we need these to be always_inline? The `inline` keyword pretty much just means that the function doesn't get a symbol, which is typical for header implementations like this. Some context in the description would help.
>
> `inline` almost means nothing for a compiler, which would not make an attempt if it is `-O0`. On the other hand, `always_inline` tells the compiler to try to inline the function regardless of optimization level. We want this to make sure that there is no multiple defined symbols in any case.
Well at `O0` I wouldn't expect it to matter, `always_inline` is more of a hack for things that *need* to be inlined or else something breaks (i.e. like LDS used to require). Using `static inline` solves the symbol collision problem AFAIK.
https://github.com/llvm/llvm-project/pull/91294
More information about the Openmp-commits
mailing list