[llvm] [FunctionAttrs] Handle alias-preserving intrinsic calls correctly (PR #68453)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 7 02:31:31 PDT 2023


nikic wrote:

> In which case, I'm confused by why the function in ValueTracking mentions `WithoutCapturing`.

The name is a bit confusing, it would be more accurate to say without *other* capturing. The point of the function is to handle functions that only capture via the return value, as that's not something that can currently be expressed with attributes.

> And by what the semantics of `nocapture` are in general - my sense of it was that a capture involves storing a pointer somewhere such that it might be used after its SSA value is out of scope, and so nocapture indicates a lack of that behavior.

See https://llvm.org/docs/LangRef.html#pointercapture, especially the comments in the first example. Your description is basically right (at least for the provenance escape part of "capture"), but applies beyond stores to memory. What matters is that the pointer outlives the call in some way.

https://github.com/llvm/llvm-project/pull/68453


More information about the llvm-commits mailing list