[PATCH] D85184: [Attributor][WIP] Deduce noundef attribute
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 4 23:32:02 PDT 2020
jdoerfert added a comment.
In D85184#2195356 <https://reviews.llvm.org/D85184#2195356>, @aqjune wrote:
> In D85184#2193446 <https://reviews.llvm.org/D85184#2193446>, @jdoerfert wrote:
>
>> Note: @aqjune, and @okura We should also seed `noundef` in the intrinsics and especially known library functions definitions. I mean, `malloc` is not returning a undef or poison value (I hope), and `free` is not accepting one.
>
> BuildLibCalls.cpp 's inferLibFuncAttributes seems to be the right place for this?
> I'll start with adding noundef to return values of library functions.
That would be great, and yest that is the right place for most of it IIRC.
> I think it is safer to
Safer than what?
> gradually add noundef to arguments of library functions, since it may cause end-to-end miscompilation (if there exists any incorrect transformation): IIRC there was a regression from strlen having nonnull attribute at its pointer argument, that happened from its interaction with llvm.assume.
I wouldn't be totally surprised if something explodes but it should not and it is good to know earlier if it does ;)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85184/new/
https://reviews.llvm.org/D85184
More information about the llvm-commits
mailing list