[PATCH] D82614: ValueTracking: Fix isKnownNonZero for non-0 null pointers for byval

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 18:35:19 PDT 2020


arsenm added a comment.

In D82614#2115882 <https://reviews.llvm.org/D82614#2115882>, @jdoerfert wrote:

> Honestly, `nonnull` should only mean `!= 0`. I guess not deducing `nonnull` from `byval` is reasonable for any `AS != 0`.
>  I'm not really in favor of making `nonnull` mean "valid pointer", `dereferenceable` is already way closer to that and `nonnull` is used as "not 0" too often already.


Without a marker for a known-invalid pointer, I don't see how you can repurpose dereferenceable to optimize out "null" checks for other invalid pointer values. The useful property is this pointer is known to never be a valid object; we don't have an isKnownNotDereferenceable


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

https://reviews.llvm.org/D82614





More information about the llvm-commits mailing list