On Mon, May 15, 2023 at 10:48 AM juzhe.zh...@rivai.ai
<juzhe.zh...@rivai.ai> wrote:
>
> Oh, I see. I try this way:
> static poly_uint64
> riscv_vectorize_preferred_vector_alignment (const_tree type)
> {
>   if (riscv_v_ext_vector_mode_p (TYPE_MODE (type)))
>     return TYPE_ALIGN (TREE_TYPE (type));
>   return TYPE_ALIGN (type);
> }
>
> And disable both TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE
> and TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST
>
> Both VLA and VLS works well after the testing of align-1.c && align-2.c
> Is the way you prefer ?
>
> But I am not sure whether it's safe since both my downstream GCC and ARM SVE 
> didn't use this approach.
> I am Ok of both for now. So do you prefer the second approach ? Then I can 
> send V2 patch.

I am not sure it's safe either, but I am not convinced we need
TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE for improving the
VLS-VLMAX alignment, so I would prefer just using
TARGET_VECTORIZE_PREFERRED_VECTOR_ALIGNMENT for now unless we found
it's not safe or we know why it's better way.

Reply via email to