[PATCH] D116998: [LangRef] Don't allow read from sret memory after unwind

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 28 06:17:46 PST 2022


nikic added a comment.

Hum, I just found this wonderful bit of code in ArgPromotion: https://github.com/llvm/llvm-project/blob/e9768a2a44a1501b82e3bbf9862b4ba2cc4b9cc3/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp#L932-L943 It replaces `sret` arguments with `noalias` arguments. So ArgPromotion could lose optimization information if the "poison on unwind" behavior is not also encoded by a separate attribute.

I find this particularly odd because I always assumed that frontends are encouraged to annotate struct return value arguments as `sret`. But now it looks like frontends actually shouldn't do that unless they must match C ABI?


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

https://reviews.llvm.org/D116998



More information about the llvm-commits mailing list