public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/105940] New: suggested_unroll_factor applying place looks wrong
@ 2022-06-13  5:59 linkw at gcc dot gnu.org
  2022-06-13  6:07 ` [Bug tree-optimization/105940] " linkw at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: linkw at gcc dot gnu.org @ 2022-06-13  5:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105940
           Summary: suggested_unroll_factor applying place looks wrong
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: linkw at gcc dot gnu.org
  Target Milestone: ---

I tried to evaluate if we can get some performance gains by setting
suggested_unroll_factor on Power, but met one ICE coming from the line:

          cached_vf_per_mode[last_mode_i]
            = exact_div (LOOP_VINFO_VECT_FACTOR (loop_vinfo),
                         loop_vinfo->suggested_unroll_factor);

With below simple hacking in rs6000 backend:

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index d7a7cfe860f..dcf2e8fc0ba 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -5490,6 +5490,8 @@ rs6000_cost_data::finish_cost (const vector_costs
*scalar_costs)
           && LOOP_VINFO_VECT_FACTOR (loop_vinfo) == 2
           && LOOP_REQUIRES_VERSIONING (loop_vinfo))
         m_costs[vect_body] += 10000;
+
+      m_suggested_unroll_factor = 4;
     }

   vector_costs::finish_cost (scalar_costs);


We can get the ICE reproduced on the below reduced test case:

_Complex *a;
_Complex b, e;
int c, d;
void f() {
  _Complex g;
  for (; d; d++)
    g += a[d * c] * e;
  b = g;
}

option: -Ofast -mcpu=power10

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-06-23  6:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-13  5:59 [Bug tree-optimization/105940] New: suggested_unroll_factor applying place looks wrong linkw at gcc dot gnu.org
2022-06-13  6:07 ` [Bug tree-optimization/105940] " linkw at gcc dot gnu.org
2022-06-13  6:08 ` linkw at gcc dot gnu.org
2022-06-13  8:25 ` rguenth at gcc dot gnu.org
2022-06-14  5:58 ` cvs-commit at gcc dot gnu.org
2022-06-14  8:46 ` linkw at gcc dot gnu.org
2022-06-15 10:13 ` cvs-commit at gcc dot gnu.org
2022-06-16 13:33 ` linkw at gcc dot gnu.org
2022-06-16 13:35 ` linkw at gcc dot gnu.org
2022-06-17 10:56 ` linkw at gcc dot gnu.org
2022-06-20 12:45 ` cvs-commit at gcc dot gnu.org
2022-06-23  1:59 ` cvs-commit at gcc dot gnu.org
2022-06-23  2:25 ` cvs-commit at gcc dot gnu.org
2022-06-23  3:20 ` linkw at gcc dot gnu.org
2022-06-23  6:28 ` rguenther at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).