[PATCH] Add loop unrolling metadata descriptions to LangRef.rst

Mark Heffernan meheff at google.com
Fri Jul 18 11:08:56 PDT 2014


Is this patch good to go?  The changes we talked about (renaming metadata)
will be in follow up patches.

Mark


On Fri, Jul 18, 2014 at 10:28 AM, Mark Heffernan <meheff at google.com> wrote:

> ================
> Comment at: docs/LangRef.rst:2965
> @@ +2964,3 @@
> +bit operand value is 0 loop unrolling is disabled. A value of 1
> +indicates that the loop should be fully unrolled. For example:
> +
> ----------------
> Mark Heffernan wrote:
> > hfinkel at anl.gov wrote:
> > > I find this confusing. Specifically, to get partial unrolling, what
> needs to happen? If I want partial unrolling with a specific count, do I
> need both the 'count' and 'enable' metadata?
> > I added a bit more explanation about that case.
> >
> > I'd imagine an underlying cause of confusion is that
> ``llvm.loop.unroll.enable 1`` doesn't exactly mean enable.  It means try to
> fully unroll the loop.  So we want the following possible hints:
> >
> > don't unroll
> > unroll fully
> > unroll by N
> >
> > This doesn't exactly map nicely to the two metadata we have (one with
> boolean operand, one with i32).  Maybe a cleaner way to have done this is
> with the following metadata:
> >
> > llvm.loop.unroll.disable (no operand)
> > llvm.loop.unroll.fully_unroll (no operand)
> > llvm.loop.unroll.count i32
> >
> > And only allow a single loop unroll metadata node per loop.  Worth
> making this change?
> I should add that this confusion is also baked into the pragma syntax.
>  The following means unroll fully:
>
> #pragma clang loop unroll(enable)
>
> http://reviews.llvm.org/D4576
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140718/63a72e5e/attachment.html>


More information about the llvm-commits mailing list