[PATCH] D89826: [FunctionAttrs][NPM] Fix handling of convergent

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 12:04:51 PDT 2020


nhaehnle added a comment.

In D89826#2347822 <https://reviews.llvm.org/D89826#2347822>, @jdoerfert wrote:

> In D89826#2346511 <https://reviews.llvm.org/D89826#2346511>, @efriedma wrote:
>
>> At a high level, it should be fine to assume an indirect call without the "convergent" attribute isn't convergent.  If the language rules for some language say the callee of an indirect call might be convergent, the frontend can add the convergent attribute to that call.  (Unlike most attributes, it's a negative attribute: it restricts optimizations, and attribute inference optimizations would remove it,)
>
> I don't object to that but I want us to remove the "may" from the lang ref and make it a "will" (or similar). It describes the semantics not the optimization we "may" perform.

I'd be fine with this change temporarily. Longer term, we should just do D85603 <https://reviews.llvm.org/D85603>.

I'd argue that making the change s/may/will/ does not actually change meaning here (because if a consumer of LLVM IR **may** treat calls this way, then any frontend must conservatively assume that it **will**), and it also doesn't change the fact that the LangRef talks about allowed optimizations instead of semantics. The latter is an inherent downside of the current definition of convergent, and one of the things that D85603 <https://reviews.llvm.org/D85603> solves.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89826



More information about the llvm-commits mailing list