https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115777

--- Comment #20 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #19)
> (In reply to Richard Biener from comment #18)
> > (In reply to Paul Menzel from comment #17)
[..]
> What changed from GCC 16 is that we no longer cost the unnecessary
> 
> *_6 1 times vec_to_scalar costs 4 in epilogue
> *_6 1 times vec_to_scalar costs 4 in epilogue
> 
> which made vectorization not profitable there.
> 
> diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
> index bc67904f4b9..b3008ee8ddc 100644
> --- a/gcc/config/i386/i386.cc
> +++ b/gcc/config/i386/i386.cc
> @@ -27994,6 +27994,7 @@ ix86_vector_costs::add_slp_cost (slp_tree node,
>              insert it via vpinsr with a memory operand.  */
>           if (def
>               && gimple_assign_load_p (def)
> +             && has_single_use (gimple_assign_lhs (def))
>               && tree_nop_conversion_p (TREE_TYPE (op),
>                                         TREE_TYPE (gimple_assign_lhs (def)))
>               && (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op))) > 1
> 
> fixes it, properly assessing
> 
> node 0x5373a40 gpr->xmm moves costs 24 in prologue
> node 0x5373a40 1 times vec_construct costs 4 in prologue
> 
> and flipping costs back to unprofitable.

That regresses

+FAIL: gcc.target/i386/pr108938-3.c scan-assembler-times bswap[\\t ]+ 3
+FAIL: gcc.target/i386/pr125026.c scan-assembler-times movabsq[
\\\\t]+\\\\\$429
4967297, %r[a-z0-9]+ 2

I have not yet investigated those.

Reply via email to