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

Hal Finkel hfinkel at anl.gov
Fri Jul 18 12:01:36 PDT 2014


Yes, I think so.

 -Hal

----- Original Message -----
> From: "Mark Heffernan" <meheff at google.com>
> To: "Mark Heffernan" <meheff at google.com>, "Hal Finkel" <hfinkel at anl.gov>
> Cc: llvm-commits at cs.uiuc.edu
> Sent: Friday, July 18, 2014 1:08:56 PM
> Subject: Re: [PATCH] Add loop unrolling metadata descriptions to LangRef.rst
> 
> 
> 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
> 
> 
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list