[PATCH] D90275: [clang][IR] Add support for leaf attribute

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 20:45:46 PST 2020


aqjune added a comment.

In D90275#2374648 <https://reviews.llvm.org/D90275#2374648>, @gulfem wrote:

> Leaf attribute is specifically intended for library functions and I think all the existing usage of leaf attribute is in the library function declarations.
> For ex, it is only used in syscalls in Fuchsia.
> Therefore, I'm not sure whether it is really necessary to ban leaf attribute in function definitions.
> Even though function attributes are typically intended to be used in the function declaration, compilers do not have policy to forbid using them in the function definition.

Maybe it's because the `leaf` (or `nocallback` or whatever) attribute at the function definition in IR can't be used for any optimization?
For the callers, `leaf` attribute at the function declarations is already giving the information.
But the attribute at function definitions really give no additional information inside the TU, so it's redundant.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90275



More information about the llvm-commits mailing list