[LLVMdev] [RFC] "noclone" function attribute

Krzysztof Parzyszek kparzysz at codeaurora.org
Sat Dec 1 08:51:55 PST 2012

On 12/1/2012 10:36 AM, James Molloy wrote:
> Either of these methods allow the user to stop LLVM "breaking their IR. I'm aware that the general case with no user help (such as force-inlining, or otherwise controlling function cloning) is a very difficult problem. My intention is that there are no corner cases *with user assistance*. Currently there is no way to stop stuff breaking *even with* user assistance! :)

I'm not against the idea, I was just pointing out that cloning of 
functions can create problems.

Here's another thing.  Imagine this code:

    if (x > 0) {
    } else {

Even though "barrier" may have side-effects, normally, it would be 
possible to pull such a call out of the if-the-else statements.  This 
cannot happen with barriers, so the attribute would also mean 
"don't-collapse" (as in "don't collapse multiple calls into one).

Here's another idea:  internally translate calls to "barrier" without 
arguments into calls to "barrier" with an argument that uniquely 
identifies the call.  The users wouldn't see it in their sources, and 
the compiler/runtime could handle it in its own way.


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation

More information about the llvm-dev mailing list