[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-05-14 Thread rsandifo at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #19 from Richard Sandiford --- (In reply to Richard Biener from comment #14) > Usually targets do have a limit on the actual length but I see > constant_upper_bound_with_limit doesn't query such. But it would > be a more

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-15 Thread kugan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #18 from kugan at gcc dot gnu.org --- Also, can we set INT_MAX when there is no explicit safelen specified in OMP. Something like: --- a/gcc/omp-low.cc +++ b/gcc/omp-low.cc @@ -6975,14 +6975,11 @@ lower_rec_input_clauses (tree

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-15 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #17 from rguenther at suse dot de --- On Mon, 15 Apr 2024, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 > > --- Comment #16 from Jakub Jelinek --- > (In reply to Richard Biener from

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-15 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #16 from Jakub Jelinek --- (In reply to Richard Biener from comment #14) > I think > > if (safelen) > { > poly_uint64 val; > safelen = OMP_CLAUSE_SAFELEN_EXPR (safelen); > if (!poly_int_tree_p (safelen, )) >

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-15 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #15 from rguenther at suse dot de --- On Mon, 15 Apr 2024, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 > > --- Comment #13 from Jakub Jelinek --- > (In reply to kugan from comment #12) >

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-15 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #14 from Richard Biener --- I think if (safelen) { poly_uint64 val; safelen = OMP_CLAUSE_SAFELEN_EXPR (safelen); if (!poly_int_tree_p (safelen, )) safelen_int = 0; else safelen_int =

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-15 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #13 from Jakub Jelinek --- (In reply to kugan from comment #12) > > Why? > > Then it just is INT_MAX value, which is a magic value that says that it is > > infinity. > > No need to say it is a poly_int infinity. > > For this test

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-15 Thread kugan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #12 from kugan at gcc dot gnu.org --- (In reply to Jakub Jelinek from comment #11) > (In reply to kugan from comment #9) > > Looking at the options, looks to me that making loop->safelen a poly_in is > > the way to go. (In reply to

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-15 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #11 from Jakub Jelinek --- (In reply to kugan from comment #9) > Looking at the options, looks to me that making loop->safelen a poly_in is > the way to go. (In reply to Jakub Jelinek from comment #4) > > The OpenMP safelen clause

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-15 Thread kugan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #10 from kugan at gcc dot gnu.org --- Created attachment 57946 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57946=edit patch patch to make loop->safelen a poly_int

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-15 Thread kugan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #9 from kugan at gcc dot gnu.org --- Looking at the options, looks to me that making loop->safelen a poly_in is the way to go. (In reply to Jakub Jelinek from comment #4) > The OpenMP safelen clause argument is a scalar integer, so

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-10 Thread kugan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 kugan at gcc dot gnu.org changed: What|Removed |Added CC||kugan at gcc dot gnu.org ---

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-08 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #7 from rguenther at suse dot de --- > Am 08.04.2024 um 16:55 schrieb tnfchris at gcc dot gnu.org > : > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 > > --- Comment #6 from Tamar Christina --- > (In reply to Jakub

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-08 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #6 from Tamar Christina --- (In reply to Jakub Jelinek from comment #4) > Now, with SVE/RISCV vectors the actual vectorization factor is a poly_int > rather than constant. One possibility would be to use VLA arrays in those >

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-08 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #5 from Jakub Jelinek --- (In reply to Richard Biener from comment #3) > As for the dependence analysis itself - the issue is that the D.5606[_33] > style accesses have no access functions - I'm not sure how they evolve, > but I see

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-08 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #4 from Jakub Jelinek --- The OpenMP safelen clause argument is a scalar integer, so using poly_int for something that must be an int doesn't make sense. Though, the above testcase actually doesn't use safelen clause, so safelen is

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-08 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 Richard Biener changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-08 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 Richard Biener changed: What|Removed |Added Keywords||openmp Blocks|

[Bug tree-optimization/114635] OpenMP reductions fail dependency analysis

2024-04-08 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114635 --- Comment #1 from Richard Biener --- Note even -fopenmp-simd would likely fail if you remove the #if _OPENMP check. -fopenmp-simd doesn't define _OPENMP, only -fopenmp does. It seems to work on x86_64 but we get a "scalar" epilog somehow.