[PATCH] D157499: [IR] Add noreadafterunwind attribute

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 12:31:50 PDT 2023


nikic added a comment.

In D157499#4577838 <https://reviews.llvm.org/D157499#4577838>, @aeubanks wrote:

> needs a verifier check that the attribute isn't a return value attribute

This is specified in Attributes.td and does not need to be separately verified (it's enforced by the IR / bitcode parser).

> a follow up change will infer this for `sret` args in `inferattrs`?

No, this won't be inferred for `sret` and should be added by the frontend instead, similar to the other attributes that usually go with sret (noalias, dereferenceable, and for many languages also nocapture). The followup would be to emit it in clang.

> is this intended to be derivable for args of internal/private functions or mostly just for `sret`/something the frontend can add?

The semantics allow deriving it (simplest case: All callers use "call" and pass an alloca to the argument) though I don't have immediate plans to implement this. We currently only perform RPO attribute inference in the late pipeline, at which point the attribute likely won't be useful anymore. If we have motivating cases for this, we could make it work though.

> what changes would need to be made to sink the store in https://gcc.godbolt.org/z/hnddhTqWa ?

I don't think we have any store sinking support at all right now, so we'd need that first. This change is primarily aimed at call slot optimization and DSE.


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

https://reviews.llvm.org/D157499



More information about the llvm-commits mailing list