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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 11:45:34 PDT 2019


efriedma added a comment.

I don't think I'd look at it in terms of a nondeterministic choice.  I'm not sure that really solves the issue, anyway, because the program flow could potentially constrain the non-determinism.

Really, I think this discussion is going in circles because we don't have a precise definition of what it means to capture a pointer.  "Does not make any copies of the pointer" is unclear.

I spent a few minutes trying to formulate a more precise rule, but the result I came up with is a mess, so I won't post it.  That said, I think the key here is that we have to make sure whatever definition we use allows GVN-like transforms to work: replacing a use of an integer value with a use of an equivalent integer value is legal, and replacing a use of a pointer value with a use of another pointer value with the same raw bits and basis is legal.  So an icmp doesn't count as a "copy" if we can compute the result some other way.


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