[PATCH] D47895: llvm: Add support for "-fno-delete-null-pointer-checks"

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 11:06:06 PDT 2018


efriedma added a comment.

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.)

It looks like you still didn't look at all the files I mentioned earlier?



================
Comment at: include/llvm/Analysis/Utils/Local.h:93
+/// Return value: true =>  null pointer dereference is not undefined.
+bool NullPointerIsDefined(const Function *F, unsigned AS = 0);
 }
----------------
Not sure I like the default argument here.


================
Comment at: lib/Transforms/IPO/GlobalOpt.cpp:642
+    if (const Instruction *I = dyn_cast<Instruction>(U)) {
+      if (NullPointerIsDefined(I->getFunction()))
+        return false;
----------------
This doesn't handle address spaces correctly... at least, not at first glance.


Repository:
  rL LLVM

https://reviews.llvm.org/D47895





More information about the llvm-commits mailing list