[PATCH] D48239: [LangRef] Clarify meaning of "dereferencable" attribute/metadata.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 10:28:47 PDT 2019


jdoerfert added a comment.

While we are going forward with the "no-free" and "no-sync" attributes, I need to also fix the ambiguity here asap.

I'll propose a patch with the alternative today. So I'll make `dereferenceable` mean dereferenceable **at this point** and for globally dereferenceable I'll add a new attribute.
This should way the patch of least resistance forward (I'll put detailed argumentation in the commit message). If it turns out we do want the opposite after all, I'm willing to
use this as a base and add a new dereferenceable at this point attribute.



================
Comment at: docs/LangRef.rst:7961
+tells the optimizer that the value loaded is known to be dereferenceable
+at any later point in the program.  If the pointer cannot be dereferenced,
+the behavior is undefined.
----------------
I'd nix 7961 and 7962 and put the following after "loaded is known to be dereferenceable":

, thus the conditions described in <link_to_dereferenceable> hold.

This way we have a single definition.


================
Comment at: docs/LangRef.rst:7972
 instruction tells the optimizer that the value loaded is known to be either
-dereferenceable or null.
+dereferenceable or null at any later point in the program.  If the pointer
+cannot be dereferenced and is not null, the behavior is undefined.
----------------
Same as above.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D48239





More information about the llvm-commits mailing list