[PATCH] D47895: llvm: Add support for "-fno-delete-null-pointer-checks"
Manoj Gupta via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 13 11:48:27 PDT 2018
manojgupta added a comment.
In https://reviews.llvm.org/D47895#1131374, @efriedma wrote:
> Tests look good, at first glance.
>
> For LangRef, I was referring to https://llvm.org/docs/LangRef.html#function-attributes, yes. (There might be some gaps in the documentation, but ideally that should cover all the function attributes recognized by LLVM transforms and code generation.)
Thanks, Will add it there.
> It looks like you still didn't look at all the files I mentioned earlier?
I went through those files but many of these addressSpace() == 0 (and != 0) checks are not for null pointers but for disabling/skipping some memory optimizations. And it is not clear to me if moving all of those checks to the new NullPointerIsDefined function makes sense there.
================
Comment at: lib/Transforms/IPO/GlobalOpt.cpp:1931
GV->getValueType()->isSingleValueType() &&
GV->getType()->getAddressSpace() == 0 &&
!GV->isExternallyInitialized() &&
----------------
This pass already skips non-zero address space values. I didn't want to bail out here since all of the accesses to a GV might be in functions without null-pointer-is-valid attribute.
Repository:
rL LLVM
https://reviews.llvm.org/D47895
More information about the llvm-commits
mailing list