Alexandre Isoard via llvm-dev
2018-Mar-06 00:42 UTC
[llvm-dev] carries_dependency attribute
Hello, I was wondering what is the semantic of the carries_dependency attribute. On https://clang.llvm.org/docs/AttributeReference.html#carries-dependency it says some suspicious things to me (but I am probably interpreting that wrong, sorry about that):> The carries_dependency attribute specifies dependency propagation into > and out of functions. >Where can it be placed? (on function declaration and/or definition?) What are its parameters? (none?)> When specified on a function or Objective-C method, the carries_dependency > attribute means that the return value carries a dependency out of the > function, so that the implementation need not constrain ordering upon > return from that function. >I was under the impression that a dependency was an ordering constraint we want to enforce... What are we trying to say here?> Implementations of the function and its caller may choose to preserve > dependencies instead of emitting memory ordering instructions such as > fences. >So, if that attribute is not here, we do not need to preserve dependencies as long as we emit a memory ordering instruction?> Note, this attribute does not change the meaning of the program, but may > result in generation of more efficient code. >I am almost certain of missing something here, else it does not make sense... Help? -- *Alexandre Isoard* -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180305/f86626ba/attachment.html>
On 3/5/2018 4:42 PM, Alexandre Isoard via llvm-dev wrote:> Hello, > > I was wondering what is the semantic of the carries_dependency attribute.It was supposed to be part of the "consume" atomic memory ordering, but in practice clang simply ignores it. -Eli -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project