[PATCH] D79636: [LangRef] Clarify the semantics of the `byval` attribute

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 9 20:12:17 PDT 2020


efriedma added a comment.

> @efriedma I'm a bit confused. Could you propose some wording so I get a feeling where you want to go?

Depending on which direction we go, either:

- "Attributes on a function or callsite describe the behavior of the callee excluding the implied copy.  For example, an optimization can infer readnone on a a byval argument if the callee does not access the copied memory."
- "Attributes on a function or callsite describe the behavior of a call including the implied copy.  For example, an optimization can never infer readnone on a call with a byval argument readnone because the implied copy reads memory.  byval implies nocapture: there isn't any way to retrieve the original address in the callee."

I don't really care which we choose, we can easily model it either way.  But I think we need to choose one or the other.  Making attributes describe different things on each side of the call is much worse than either of those alternatives; it confuses what it means for a function or callsite to have an attribute.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79636





More information about the cfe-commits mailing list