[PATCH] D89050: Add support for !noundef metatdata on loads

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 9 20:17:09 PDT 2020


jdoerfert added a comment.

In D89050#2320052 <https://reviews.llvm.org/D89050#2320052>, @nikic wrote:

> In D89050#2320036 <https://reviews.llvm.org/D89050#2320036>, @jdoerfert wrote:
>
>>> For some frontends (that model safe languages) it might be that *all* loads are noundef.
>>
>> I would consider a function/module attribute for this.
>
> Only loads emitted by the frontend would be noundef, optimization may introduce or move loads in a way that they are no longer noundef. I think such an attribute would violate LLVMs usual attribute design, as optimizations would now have to worry about dropping function attributes when performing speculation etc (is there any precedent for something like this?) We'd also lose the noundef property for all loads in a function at once, if a single one of them is speculated.

Yeah, good point ;). Bundling `noundef` in a single assume still works though ;)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89050



More information about the llvm-commits mailing list