[PATCH] D85393: [WIP] [IR] Adding noprogress as a LLVM IR attribute

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 15:52:14 PDT 2020


jdoerfert added a comment.

In D85393#2206044 <https://reviews.llvm.org/D85393#2206044>, @RalfJung wrote:

>> It isn't contradiction, but about whether noprogress brings useful information or not, though.
>
> The presence of "noprogress" doesn't bring much information, but its absence does.

It depends on how you look at it:
>From the perspective of optimizations we can do, sure absence is the one that enables more.
>From the perspective of source behavior, it just distinguishes between two alternatives, so both option w/ and w/o flag have the same information value.

> Even if we keep the polarity, maybe it would be better to call it "maybenoprogress" or "maybeprogress"? After all, "noprogress" sounds like it asserts that the function will not make progress, when really the flag that that the function *is permitted to make no progress* (unlike functions without this attribute, which have to make progress).

That is fair. `maybe...` or `mayprogress` or `mayloop` or `mayspin`? Naming things is hard ...

In D85393#2205925 <https://reviews.llvm.org/D85393#2205925>, @aqjune wrote:

> In D85393#2205762 <https://reviews.llvm.org/D85393#2205762>, @jdoerfert wrote:
>
>> Let's first create the Lang Ref patch before we dive into details here. Generally, we will need verifier checks, yes. FWIW, `noprogress` is unrelated to `willreturn` and `noreturn` though.
>
> IIUC, a function makes progress if the function has `willreturn` - wouldn't it make `noprogress` give no information?
> It isn't contradiction, but about whether `noprogress` brings useful information or not, though.

So this is a may/must difference and these attributes also do not perfectly match. However:
`willreturn` implies `must-make-progress` (as it cannot loop), which then allows you to remove this attribue (`maybe-no-progress`) as it actually will make progress.
Even when `willreturn` is not applicable you can have `must-make-progress`. It basically is the attribute we implicitly assume right now. Though I don't have a reason handy why you would derive the `must-make-progress` and remove the `may-...` version. If the user/input gives you both, that is a different story though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85393



More information about the llvm-commits mailing list