[PATCH] D60047: [CaptureTracking] Don't let comparisons against null escape inbounds pointers

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 15:43:18 PDT 2019


jdoerfert added a subscriber: chandlerc.
jdoerfert added a comment.

In D60047#1492510 <https://reviews.llvm.org/D60047#1492510>, @efriedma wrote:

> > Left is only the single guess that is just right which I would not count as escaping because the program could just as well take the guessed value and pretend it is the pointer value without the check.
>
> This argument makes sense. But I'd like to see better definitions of nocapture and dereferenceable_or_null in LangRef which make this a little more obvious.


Agreed. I was actually talking to @chandlerc about the current `nocapture` semantic at EuroLLVM because I want/introduced `nocapture-maybe-returned` for the Attributor in D59922 <https://reviews.llvm.org/D59922>.
It is also not very well specified how "undefined" it is to have something neither null nor dereferenceable where an "dereferenceable_or_null(X > 0)" was expected. In my above reasoning, I simply made it "very undefined".

Long story short, I'll come up with some LangRef patches soonish to clarify things I think are underspecified. (There were multiple situations already, especially while working on the Attributor, where I made assumptions based on what I think the rest of LLVM does. Now with GSoC students working on the Attributor, I will also get input from "outside" people which is probably good as well.)


Repository:
  rL LLVM

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

https://reviews.llvm.org/D60047





More information about the llvm-commits mailing list