[PATCH] D157499: [IR] Add noreadafterunwind attribute

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 01:11:08 PDT 2023


nikic added a comment.

In D157499#4583878 <https://reviews.llvm.org/D157499#4583878>, @jdoerfert wrote:

> I get the motivation, though, I'm not happy as this is super specific "no-read" and "after-unwind".
>
> I'm spitballing mostly:
>
> What about "dead-after-unwind", or is it used but not read specifically?

I think the thing we really want to convey is that "memory contents do not matter after unwind". There shouldn't be "real" reads or writes after unwind, but there may be a lifetime.end, which we'd usually consider a write.

Something I suggested in previous discussions was to make this "poison on unwind", which does give us the "memory contents do not matter" property without actually forbidding further reads or writes. I think this is what we want in terms of semantics, but I find the name quite intuitive (because it's phrased in terms of an additional virtual action performed on unwind that happens to imply a restriction). Maybe calling it "dead on unwind" with those poison semantics would be reasonable? After all, a write of poison is how we tend to model lifetime end.

> Different thought: `memory(after_unwind: none)`?

This is just for a single argument, while `memory()` applies to the whole function.

> Also, do we just concatenate words?

We have a mix of both, I wouldn't mind making this no_read_after_unwind instead.


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

https://reviews.llvm.org/D157499



More information about the llvm-commits mailing list