[llvm-dev] RFC: Removal of noduplicate attribute

Nicolai Hähnle-Montoro via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 29 08:38:39 PDT 2019

On Tue, Oct 29, 2019 at 11:57 AM Savonichev, Andrew via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> > These are good points. I think the first question should be: Do we know
> > of any active users of this attribute right now? If not, deprecation
> > seems like something we could do, e.g., through a warning in clang and
> > in the middle-end to ensure other front-ends are aware of it as well.
> Noduplicate attribute is still used by the Intel OpenCL Compiler for CPU.
> The main use case is to prevent loop unroll when an OpenCL barrier is called
> within a loop. Although such loop can be unrolled and keep its semantic intact, but
> this introduces a lot of distinct barrier calls, and each of them has to
> be handled separately.
> In other words, "noduplicate" serves as a hint to not unroll a loop if a
> certain function is called in a loop body.

I don't quite understand the reasoning behind this. Is it because your
backend turns each individual barrier call into a large chunk of code?

If so, would it be a long-term viable alternative to inform the
various code size heuristics about this instead of using

Lerne, wie die Welt wirklich ist,
aber vergiss niemals, wie sie sein sollte.

More information about the llvm-dev mailing list