[Openmp-commits] [PATCH] D81054: [OpenMP] Introduce target memory manager

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Aug 4 23:40:32 PDT 2020


jdoerfert added inline comments.


================
Comment at: openmp/libomptarget/src/memory.cpp:66
+  return L;
+}
+
----------------
tianshilei1992 wrote:
> jdoerfert wrote:
> > `-inline` `+static`
> I didn't get that. Why does `inline` not work here? This function is so simple such that I would like to see it is inlined by the compiler.
`inline` is two things: a "hint" which affects the inliner heuristic and a way to get `linkonce_odr` linkage for functions. It is not a way to force inlining, that is `__attribute__((always_inline))`. That said, there is no need to tell the inliner what to do anyway but always limit the lifetime of things, so make them `static` if possible. Take a look at https://godbolt.org/z/Mjnhe8 to see the effects different annotations have.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81054/new/

https://reviews.llvm.org/D81054



More information about the Openmp-commits mailing list