[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-11 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. > But it does mess with the ABI; that's why it's being added. My worry is, that we do not clearly sate it does. I'm worried front-ends will use it to attach types to pointers once pointers do not have types anymore. I'll stop arguing on this one now, if you think

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-11 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D81311#2088568 , @jdoerfert wrote: > In D81311#2088075 , @rjmccall wrote: > > > In D81311#2087592 , @jdoerfert > > wrote: > > > > > In

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-11 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm added a comment. In D81311#2088568 , @jdoerfert wrote: > In D81311#2088075 , @rjmccall wrote: > > > In D81311#2087592 , @jdoerfert > > wrote: > > > > > In

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-11 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. In D81311#2088075 , @rjmccall wrote: > In D81311#2087592 , @jdoerfert wrote: > > > In D81311#2086326 , @rjmccall > > wrote: > > > > > In

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-11 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D81311#2087592 , @jdoerfert wrote: > In D81311#2086326 , @rjmccall wrote: > > > In D81311#2086227 , @jdoerfert > > wrote: > > > > > Do we allow

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-11 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. In D81311#2086326 , @rjmccall wrote: > In D81311#2086227 , @jdoerfert wrote: > > > Do we allow `inmem` to be used for other purposes? I would assume the > > answer is yes, as we do not

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-10 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D81311#2086227 , @jdoerfert wrote: > Do we allow `inmem` to be used for other purposes? I would assume the answer > is yes, as we do not forbid it. I don't know what else we might use it for off-hand, but yes, I think the

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-10 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. Do we allow `inmem` to be used for other purposes? I would assume the answer is yes, as we do not forbid it. I ask because front-ends might use this as a way to add type information to a pointer (especially after we strip them). Or am I confusing something here? >

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-10 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm added a comment. In D81311#2084066 , @rjmccall wrote: > In D81311#2083295 , @arsenm wrote: > > > In D81311#2078235 , @rjmccall > > wrote: > > > > > I wonder if

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-09 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D81311#2083295 , @arsenm wrote: > In D81311#2078235 , @rjmccall wrote: > > > I wonder if `byref` would be a better name for this, as a way to say that > > the object is semantically a

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-09 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm added a comment. In D81311#2078235 , @rjmccall wrote: > I wonder if `byref` would be a better name for this, as a way to say that the > object is semantically a direct argument that's being passed by implicit > reference. This is probably a

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-06 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D81311#2077944 , @arsenm wrote: > In D81311#2077868 , @rjmccall wrote: > > > Most of the generalized optimization properties of this attribute seem to > > be redundant with existing

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-06 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. I wonder if `byref` would be a better name for this, as a way to say that the object is semantically a direct argument that's being passed by implicit reference. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81311/new/ https://reviews.llvm.org/D81311

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-05 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm added a comment. In D81311#2077868 , @rjmccall wrote: > Most of the generalized optimization properties of this attribute seem to be > redundant with existing attributes. What are the properties you're trying to > convey exactly? The argument

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-05 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. I think the important bit here is that we need to distinguish between the C function types `void f(A)` and `void f(A*)`. If they're both lowered to pointers with the same type, we need an attribute to distinguish them. CHANGES SINCE LAST ACTION

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-05 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Most of the generalized optimization properties of this attribute seem to be redundant with existing attributes. What are the properties you're trying to convey exactly? The argument is a pointer to memory of a certain size and alignment, and that memory is known to

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-05 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. On a normal, stack-based machine, there are two ways to pass an aggregate to a function: directly, or indirectly. Directly means something like "byval" or "preallocated": the value of the pointer is not a value the caller can control, but instead refers to some fixed

[PATCH] D81311: [RFC] LangRef: Define inmem parameter attribute

2020-06-05 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm created this revision. arsenm added reviewers: rjmccall, jdoerfert, efriedma, t-tye, yaxunl, scott.linder, rnk, spatel, lebedev.ri, nlopes, fhahn, hfinkel, Anastasia. Herald added subscribers: tpr, wdng. Herald added a project: LLVM. This allows tracking the in-memory type of a pointer