[PATCH] D157499: [IR] Add dead_on_unwind attribute

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 04:53:47 PDT 2023


nikic added a comment.

In D157499#4586505 <https://reviews.llvm.org/D157499#4586505>, @efriedma wrote:

> The "underlying object of a pointer argument" is not something that's defined in LangRef.  And if you mean something like getUnderlyingObject(), that has weird consequences for the semantics of memory allocation.

I've replaced "underlying object" with "allocated object". I don't think we define that term either, but we do use it to specify various things, including GEP semantics.

The motivation for talking about objects here is to avoid the need to reason about extents. The semantics could be coupled to dereferenceable, but that would make require additional checks for every use of the attribute for no clear benefit.

> Maybe what you actually want is "any values stored through this pointer will not be read by the caller if this call unwinds", or something like that?

That would work, with the caveat that "any values stored" needs to include stores that don't exist in the original program. For call slot optimization we may be introducing additional stores, not removing them.


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

https://reviews.llvm.org/D157499



More information about the llvm-commits mailing list