[PATCH] D85184: [Attributor][WIP] Deduce noundef attribute
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 5 21:03:31 PDT 2020
jdoerfert added a comment.
In D85184#2197413 <https://reviews.llvm.org/D85184#2197413>, @aqjune wrote:
> I made D85345 <https://reviews.llvm.org/D85345>.
I saw, cool!
> Rather than adding noundef to all library functions' return values, I chose standard I/O functions and added noundef to its return values / arguments instead.
> The reason is that some functions did not seem to be clear whether its return value is noundef.
> `memcmp` is one example. `(load p) - (load q)` can be folded into `memcmp(p, q, bytesz)`, but the former expression can be poison or undef whereas the latter one raises UB in that case.
I don't think all of them should have `noundef` everywhere but some. The return of `malloc` and the argument of `free` were my examples. I/O as a start is good too.
> (than adding noundef to all library functions' args :)
I never tried to say "all" ;)
@okura there is one comment wrt. the MBEC context that needs to be addressed, I think the rest is fine.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85184/new/
https://reviews.llvm.org/D85184
More information about the llvm-commits
mailing list