[PATCH] D47747: [LangRef] Clarify "undefined" for various instructions.

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 6 02:55:14 PDT 2018


hfinkel added subscribers: rsmith, chandlerc.
hfinkel added inline comments.


================
Comment at: docs/LangRef.rst:1131
+    the duration of the function. If the pointer cannot be dereferenced at any
+    point in the function, the behavior is undefined. This
     attribute may only be applied to pointer typed parameters. A pointer that
----------------
Chatting offline with @chandlerc and @rsmith , we currently have a problem with the way we use dereferenceable in Clang. We add this attribute for references, but it's possible to free the underlying storage during the execution of the function. I'd prefer to fix this by saying that dereferenceable only guarantees its properties at function entry, as this lets us preserve some of the optimization benefit (where the existing semantics can be obtained, in large part, by combining dereferenceable with noalias or noalias metadata).

We should discuss what we'd like to do here.


Repository:
  rL LLVM

https://reviews.llvm.org/D47747





More information about the llvm-commits mailing list