[PATCH] D92623: [inliner] Apply nomerge attribute to all call sites inside inlined function.

Zequan Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 7 14:06:37 PST 2020


zequanwu added a comment.

In D92623#2438080 <https://reviews.llvm.org/D92623#2438080>, @asbirlea wrote:

> According to: https://clang.llvm.org/docs/AttributeReference.html#nomerge, the existance of the attribute should prevent call site merging, so the change makes sense.
> However, in the test example then, if there was branching and two `@f` calls inside `@bar`, it would be correct to merge the `@f` call sites (no attribute preventing that inside) when processing `@bar`. But after inlining, that's no longer allowed if the attribute is distributed to all callsites inside the function.
> This is a contradiction that needs clarification from folks more familiar with the Inliner.

Good point. I didn't consider this before.

I think I should adding a new `no-merge` as a function attribute which prevent all the function call from merging. Why not making `nomerge` as both statement attribute and function attribute? Currently, it's not allowed to do so in `Attr.td`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92623



More information about the llvm-commits mailing list