Hi,
At the moment the vectorize_width(X) #pragma is used to provide hints to LLVM
about which vectorisation factor to use. The unsigned argument ‘X’ used to match
the NumElements property in the VectorType class, however VectorType is now
defined in terms of a ElementCount class.
I’d like to propose an extension to the vectorize_width #pragma that now takes
an optional second parameter of ‘fixed’ or ‘scalable’ that matches up with
ElementCount. When not specified the default value would be ‘fixed’. A few
examples of how this would look like are shown below:
// Vectorize the loop with <4 x eltty>
#pragma clang loop vectorize_width(4)
#pragma clang loop vectorize_width(4, fixed)
// Vectorize the loop with <vscale x 4 x eltty>
#pragma clang loop vectorize_width(4, scalable)
As a further extension I’d also like to permit vectorize_width(fixed|scalable) to
allow users to hint at the type of vector used without specifying the
vectorisation factor. Examples of this would be:
// Vectorize the loop with for a profitable N
#pragma clang loop vectorize_width(fixed)
// Vectorize the loop with for a profitable N
#pragma clang loop vectorize_width(scalable)
Any thoughts you have would be much appreciated!
Kind Regards,
David Sherwood.