> -----Original Message-----
> From: Jakub Jelinek <ja...@redhat.com>
> Sent: Tuesday, May 13, 2025 11:49 AM
> To: Tamar Christina <tamar.christ...@arm.com>
> Cc: Jonathan Wakely <jwak...@redhat.com>; gcc-patches@gcc.gnu.org; nd
> <n...@arm.com>; rguent...@suse.de
> Subject: Re: [PATCH 1/4]middle-end: document pragma unroll n
> <requested|preferred> [PR116140]
> 
> On Tue, May 13, 2025 at 10:40:16AM +0000, Tamar Christina wrote:
> > That's true.  The names are already optional, I can just drop the 
> > "requested"
> > all together.
> >
> > I'll give it a few to give others a chance to commit and I'll respin 
> > dropping
> "requested"
> 
> Is the intended behavior of the "weak" version that the compiler can
> increase or decrease it based on command line options etc., or that it
> must unroll at least N times but with command line options etc. it could
> be something higher than that?

The former, the "weak" version essentially fully defers to the target and 
cunroll
heuristics.  Essentially it drops the unroll amount.

The reason for this was because some targets have heuristics that try to 
estimate
unrolling based on throughput of the loop.  So unrolling less is a valid choice 
as is
unrolling more.

Cheers,
Tamar

> 
> Perhaps
> #pragma GCC unroll 16
> vs.
> #pragma GCC unroll >= 16
> or
> #pragma GCC unroll 16+
> ?
> As for keywords, I was worried about macros, but seems GCC unroll pragma
> doesn't have macro expansion in the name nor arguments part, so when one
> wants to macro expand the count, one needs to use _Pragma and create the
> right expression as string literal.
> 
>       Jakub

Reply via email to