[PATCH] D94180: [SimplifyCFG] Optimize CFG when null is passed to a function with nonnull argument.
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 7 09:53:33 PST 2021
jdoerfert added a comment.
(Don't wait for me to finish the review)
================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6591-6592
+ if (auto *CB = dyn_cast<CallBase>(Use)) {
+ if (NullPointerIsDefined(CB->getFunction()))
+ return false;
+ // A call to null is undefined.
----------------
xbolva00 wrote:
> lebedev.ri wrote:
> > And what if `C` is actually `undef`?
> So in this case, we require noundef attribute only (?) @aqjune
>
> I will add a testcase.
`noundef undef` -> instant UB
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94180/new/
https://reviews.llvm.org/D94180
More information about the llvm-commits
mailing list