This adds the LangRef wording for the memory attribute proposed at https://discourse.llvm.org/t/rfc-unify-memory-effect-attributes/65579.
The old attributes are not removed from LangRef until the migration is finished.
Differential D135597
[LangRef] Add memory attribute nikic on Oct 10 2022, 8:59 AM. Authored by
Details This adds the LangRef wording for the memory attribute proposed at https://discourse.llvm.org/t/rfc-unify-memory-effect-attributes/65579. The old attributes are not removed from LangRef until the migration is finished.
Diff Detail
Event TimelineComment Actions I'm pretty happy with the proposed spelling.
Comment Actions Mention default (all effects) and how effects for a call are derived from call-site and function attributes. Comment Actions Do we need two spelling "`memory() or memory(none)`:"? We should talk about call sites not calls, as we refer to them as "call site attributes".
Comment Actions Nope. I'll drop the memory() spelling.
Comment Actions Drop memory() spelling, add other example, use code to explain intersection behavior.
Comment Actions Just FYI, https://github.com/llvm/llvm-project/issues/54312 :
What do you think, should 'memory' attribute take arg-index and size-index into account to support use cases like access attribute in C? Comment Actions I don't think so. The memory attribute describes the memory effects of the whole call/function. We have separate attributes that apply to individual arguments. Comment Actions I like the wording now, thanks for the changes. Others should approve as well though. I agree. Argument access information should be attached to the arguments. declare i8* memcpy(i8* access(write[0:arg(2)]) %dst, i8* access(read[0:arg(2)]) %src, i32 %size) memory(argmem: readwrite) And we should do this after. |
Since this is a new kind of "composite" attribute, it should be clearly stated: