[PATCH] D92297: [CodeGen] -fno-delete-null-pointer-checks: change dereferenceable to dereferenceable_or_null

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 30 09:30:00 PST 2020


jdoerfert added a comment.

In D92297#2422568 <https://reviews.llvm.org/D92297#2422568>, @bkramer wrote:

> While it would be nice for `dereferenceable` to not imply nonnull, the implementation currently assumes it does and will speculate loads based on that. See `llvm::Value::getPointerDereferenceableBytes` and its users.

LLVM-Core unfortunately conflated `null` as 0x000000 and as "invalid pointer"/"non-dereferencable". This patch just works around that. While this is fine for now, a FIXME should be placed and LLVM-Core needs fixing.

I briefly scanned my history and found D66664 <https://reviews.llvm.org/D66664> which is relevant and gives some context and my attempt to fix this last year.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92297



More information about the cfe-commits mailing list