[Bug tree-optimization/115537] [15 Regression] vectorizable_reduction ICEs after g:d66b820f392aa9a7c34d3cddaf3d7c73bf23f82d

2024-06-18 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115537

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |15.0
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2024-06-18
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
I will have a look.

[Bug tree-optimization/115537] [15 Regression] vectorizable_reduction ICEs after g:d66b820f392aa9a7c34d3cddaf3d7c73bf23f82d

2024-06-18 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115537

--- Comment #2 from Richard Biener  ---
So w/o SLP we reject this with

  if ((double_reduc || reduction_type != TREE_CODE_REDUCTION)
  && ncopies > 1)
{ 
  if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
 "multiple types in double reduction or condition "
 "reduction or fold-left reduction.\n");
  return false;

reduction_type is EXTRACT_LAST_REDUCTION here.  For SLP we only disallow

  if ((reduction_type == COND_REDUCTION
   || reduction_type == INTEGER_INDUC_COND_REDUCTION
   || reduction_type == CONST_COND_REDUCTION)
  && slp_node
  && SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) > 1)
{
  if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
 "multiple types in condition reduction reduction.\n");
  return false;
}

I've recently fixed a fold-left reduction case with multiple types
which we handle just fine.  I have a patch amending the above condition
(EXTRACT_LAST is an optimized COND_REDUCTION).

[Bug tree-optimization/115537] [15 Regression] vectorizable_reduction ICEs after g:d66b820f392aa9a7c34d3cddaf3d7c73bf23f82d

2024-06-18 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115537

--- Comment #3 from GCC Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:7f9be55a4630134a237219af9cc8143e02080380

commit r15-1407-g7f9be55a4630134a237219af9cc8143e02080380
Author: Richard Biener 
Date:   Tue Jun 18 14:00:52 2024 +0200

tree-optimization/115537 - ICE with SLP condition reduction vectorization

The condition rejecting "multiple-type" SLP condition reduction lacks
handling EXTRACT_LAST reductions.

PR tree-optimization/115537
* tree-vect-loop.cc (vectorizable_reduction): Also reject
SLP condition reductions of EXTRACT_LAST kind when multiple
statement copies are involved.

* gcc.dg/vect/pr115537.c: New testcase.

[Bug tree-optimization/115537] [15 Regression] vectorizable_reduction ICEs after g:d66b820f392aa9a7c34d3cddaf3d7c73bf23f82d

2024-06-18 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115537

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #4 from Richard Biener  ---
Fixed.

[Bug tree-optimization/115537] [15 Regression] vectorizable_reduction ICEs after g:d66b820f392aa9a7c34d3cddaf3d7c73bf23f82d

2024-06-18 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115537

--- Comment #5 from Tamar Christina  ---
Thanks for the fix!

I think the testcase needs SVE enabled to ICE no?
shouldn't that be -mcpu=neoverse-v1 and not -mcpu=neoverse-n1?

[Bug tree-optimization/115537] [15 Regression] vectorizable_reduction ICEs after g:d66b820f392aa9a7c34d3cddaf3d7c73bf23f82d

2024-06-18 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115537

--- Comment #6 from rguenther at suse dot de  ---
> Am 18.06.2024 um 16:11 schrieb tnfchris at gcc dot gnu.org 
> :
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115537
> 
> --- Comment #5 from Tamar Christina  ---
> Thanks for the fix!
> 
> I think the testcase needs SVE enabled to ICE no?
> shouldn't that be -mcpu=neoverse-v1 and not -mcpu=neoverse-n1?

I intended to copy from the PR options, in case I mistyped feel free to correct 

> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You are the assignee for the bug.

[Bug tree-optimization/115537] [15 Regression] vectorizable_reduction ICEs after g:d66b820f392aa9a7c34d3cddaf3d7c73bf23f82d

2024-07-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115537

--- Comment #7 from GCC Commits  ---
The master branch has been updated by Tamar Christina :

https://gcc.gnu.org/g:adcfb4fb8fb20a911c795312ff5f5284dba05275

commit r15-1842-gadcfb4fb8fb20a911c795312ff5f5284dba05275
Author: Tamar Christina 
Date:   Thu Jul 4 11:19:20 2024 +0100

testsuite: Update test for PR115537 to use SVE .

The PR was about SVE codegen, the testcase accidentally used neoverse-n1
instead of neoverse-v1 as was the original report.

This updates the tool options.

gcc/testsuite/ChangeLog:

PR tree-optimization/115537
* gcc.dg/vect/pr115537.c: Update flag from neoverse-n1 to
neoverse-v1.