[PATCH] D153511: [BasicAA] Don't short-circuit non-capturing arguments

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 14:18:13 PDT 2023


fhahn added a comment.

In D153511#4442568 <https://reviews.llvm.org/D153511#4442568>, @nikic wrote:

> CaptureTracking handles both captures and escapes. There is no escape in this case. No escape does //not// imply that memory is not accessed, just that provenance is not //retained// after the call.
>
> BasicAA is making assumptions about how the CaptureTracking implementation works here, which goes beyond the actual capture/escape properties. Those assumptions are close, but not quite correct.

Right, IIUC the code in BasicAA assumes escaping pointers to not be visible outside the current function, which includes not being passed to readonly functions. I was initially (incorrectly) assuming this is what our APIs would consider an escape. It might be worth to have an option to track this property for AA.


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

https://reviews.llvm.org/D153511



More information about the llvm-commits mailing list