[clang] [llvm] [IR] Make dead_on_return attribute optionally sized (PR #171712)

Aiden Grossman via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 22 10:39:14 PST 2025


boomanaiden154 wrote:

> IIRC DSE implicitly relies on the store also being dead on unwind if it's dead on return. Though I guess for that it's not strictly necessary to change dead_on_unwind, as long as we specify that dead on return only implies dead on unwind for the same range.

I've updated the langref entry to mention that `dead_on_return` only implies `dead_on_unwind` for the specific range.

> The variable offset case is the one I had in mind here.

Ack. I've updated the patch to preserve a unsized `dead_on_return`. I've implemented it as an integer attribute that uses the sentinel value of the uint64_t max to represent an unsized `dead_on_return` attribute instance. It looks like some of the other attributes wrap things in structs, but that doesn't seem necessary here given `std::optional` appropriately captures what we need and is also seemingly a canonical design pattern.

https://github.com/llvm/llvm-project/pull/171712


More information about the cfe-commits mailing list