sdesmalen added a comment.

In D89031#2391248 <https://reviews.llvm.org/D89031#2391248>, @SjoerdMeijer 
wrote:

> In D89031#2391160 <https://reviews.llvm.org/D89031#2391160>, @david-arm wrote:
>
>> Hi @SjoerdMeijer I think that given we now support scalable vectors we 
>> thought it made sense to be able to specify whether the user wants 'fixed' 
>> or 'scalable' vectorisation along with the vector width, although without 
>> specifying the additional property the default continues to remain 'fixed'. 
>> However, what you said about having a vectorize_scalable pragma is correct 
>> and we are intending to also add a pragma like this in a future patch.
>
> Okay, I haven't looked at the implementation to be honest, but am just trying 
> to understand the different use cases of this first.
> I just seem to be missing or not understanding why fixed/scalable is an 
> option to only vectorize_width, why not to vectorize(enable) or just a 
> separate one like vectorize_scalable? By making scalable/fixed and option to 
> vectorize_width, you can't toggle this for other pragmas like 
> interleave(enable) that enable vectorisation, which would be inconsistent? It 
> also seems to be more work to me to do this first for vectorize_width, and 
> then fix up other pragmas later. But I might be missing something (obivous) 
> here.

Hi @SjoerdMeijer, all valid and good questions. We think it makes sense to 
allow specifying explicitly what the meaning of '4' is when specifying the 
width. So that `vectorize_width(4, fixed)` means vectorizing with `<4 x eltty>` 
and `vectorize_width(4, scalable)` means vectorizing with `<vscale x 4 x 
eltty>`. Like @david-arm said, we also plan to add something like 
`vectorize_style(fixed|scalable)`. This approach should be fully complementary 
to `vectorize_with` so that it would be possible to have:

  // Use scalable vectors, but leave it to the cost-model to choose the most 
efficient N in <vscale x N x eltty>.
  // If the pragma is not specified, it defaults to vectorize_style(fixed).
  #pragma clang loop vectorize_style(scalable)
  
  // Use <4 x eltty>
  #pragma clang loop vectorize_width(4, fixed)
  
  // Use <vscale x 4 x eltty>
  #pragma clang loop vectorize_width(4, scalable)
  
  // If vectorize_style(scalable) is specified, then use <vscale x 4 x eltty>, 
otherwise <4 x eltty>
  #pragma clang loop vectorize_width(4)                           // uses <4 x 
eltty>
  #pragma clang loop vectorize_width(4) vectorize_style(scalable) // uses 
<vscale x 4 x eltty>
  
  // Conflicting options, clang should print diagnostic and error or ignore the 
hint.
  #pragma clang loop vectorize_width(4, fixed) vectorize_style(scalable)

I hope that gives a bit more context.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89031/new/

https://reviews.llvm.org/D89031

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to