[PATCH] D30667: GVNHoist: handle basic blocks with UnreachableInst

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 16:57:18 PDT 2017


hfinkel added a comment.

In https://reviews.llvm.org/D30667#700066, @efriedma wrote:

> > There is? We could propagate the unreachableness of this function to its callsites, but I don't see what that has to do with the value of the function argument.
>
> LangRef states "This indicates that the parameter or return pointer is not null", i.e. if the parameter is null, the function has undefined behavior.  The function in my example always has undefined behavior, therefore it has undefined behavior if you call it with a null pointer, therefore you can mark the parameter nonnull.


Indeed. ;)


Repository:
  rL LLVM

https://reviews.llvm.org/D30667





More information about the llvm-commits mailing list