[cfe-dev] Proposed changes to vectorize_width #pragma

David Sherwood via cfe-dev cfe-dev at lists.llvm.org
Tue Dec 1 05:46:44 PST 2020


So by adding support for scalable vectorisation widths we are effectively
updating the pragma to mirror the existing VectorType class in LLVM, 
which is defined by a ElementCount and an element Type. The
ElementCount is a tuple consisting of a minimum number of elements
and a scalable flag. The meaning of 'scalable' as used in the vectorize_width
pragma as identical to that of ElementCount. Using one of my examples
in the initial proposal then this pragma

#pragma clang loop vectorize_width(4, scalable)

would mean the same in LLVM as a VectorType like this:

<vscale x 4 x eltty>

where eltty depends upon the types used in the loop. The 'vscale' parameter
is defined by the target - it is at least 1 and does not have to be a power of 2.

Kind Regards,

-----Original Message-----
From: Michael Kruse <llvm at meinersbur.de> 
Sent: 30 November 2020 18:01
To: Sjoerd Meijer <Sjoerd.Meijer at arm.com>
Cc: David Sherwood <David.Sherwood at arm.com>; cfe-dev at lists.llvm.org; Sander De Smalen <Sander.DeSmalen at arm.com>
Subject: Re: [cfe-dev] Proposed changes to vectorize_width #pragma

Am Mi., 25. Nov. 2020 um 10:15 Uhr schrieb Sjoerd Meijer via cfe-dev
<cfe-dev at lists.llvm.org>:
> I think that leaves us with 2 options that can express the same things, i.e. change or introduce:
> 1)
> vectorize_width(VF, fixed|scalable)
> vectorize_width(fixed|scalable)
> vectorize_width(VF)
> 2)
> vectorize_style(fixed|scalable)

Another proposal:

vectorize_width(VF) // For fixed vector width.
vectorize_width_at_least(MinVF) // For SVE; alternatives:
vectorize_dynamic, vectorize_scalable.

What are the intended semantics? Does scalable mean "width of MinVF or
more", "any multiple of MinVF",  "power-of-2 multiple of MinVF", "any
width of at least MinVF allowed by ARM's SVE"?


More information about the cfe-dev mailing list