public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/101120] New: vn_reference_maybe_forwprop_address can take much compile-time
@ 2021-06-18 11:33 rguenth at gcc dot gnu.org
  2021-06-18 11:33 ` [Bug tree-optimization/101120] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-18 11:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101120
           Summary: vn_reference_maybe_forwprop_address can take much
                    compile-time
           Product: gcc
           Version: 11.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

For polyhedron doduc.f90 I see

 tree FRE                           :   5.05 ( 47%)   0.03 ( 14%)   5.16 ( 46%)
 5780k (  3%)

with -Ofast -march=haswell

and

 tree iv optimization               :   4.99 ( 40%)   0.13 ( 33%)   5.28 ( 40%)
  218M ( 51%)

with -Ofast

Resulting from the vectorizer generating chains of constant adds
(_1 = _2 + 8 + 8 + 8 + 8 spread across multiple stmts).  There's duplicate
bugs for this around but a possible cheap mitigation would be to fold those
to create cheaper to walk use-def chains for the passes between vectorization
and the next forwprop pass.

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

* [Bug tree-optimization/101120] vn_reference_maybe_forwprop_address can take much compile-time
  2021-06-18 11:33 [Bug tree-optimization/101120] New: vn_reference_maybe_forwprop_address can take much compile-time rguenth at gcc dot gnu.org
@ 2021-06-18 11:33 ` rguenth at gcc dot gnu.org
  2021-06-18 12:06 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-18 11:33 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
   Last reconfirmed|                            |2021-06-18
     Ever confirmed|0                           |1
           Keywords|                            |compile-time-hog
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'll see to do that.

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

* [Bug tree-optimization/101120] vn_reference_maybe_forwprop_address can take much compile-time
  2021-06-18 11:33 [Bug tree-optimization/101120] New: vn_reference_maybe_forwprop_address can take much compile-time rguenth at gcc dot gnu.org
  2021-06-18 11:33 ` [Bug tree-optimization/101120] " rguenth at gcc dot gnu.org
@ 2021-06-18 12:06 ` rguenth at gcc dot gnu.org
  2021-06-21 13:02 ` cvs-commit at gcc dot gnu.org
  2021-06-21 13:03 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-18 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 51034
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51034&action=edit
patch

That fixes the attached but we also have loads of dead loads around which
exposes
the IV opts issue at -Ofast where IVOPTs analyzes all the dead loads
with zero-use LHS.  While we have

          PUSH_INSERT_PASSES_WITHIN (pass_vectorize)
              NEXT_PASS (pass_dce);
          POP_INSERT_PASSES ()

there's no such attempt after SLP passes.

But pruning the DR chain after SLP permute is possible as another hack.

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

* [Bug tree-optimization/101120] vn_reference_maybe_forwprop_address can take much compile-time
  2021-06-18 11:33 [Bug tree-optimization/101120] New: vn_reference_maybe_forwprop_address can take much compile-time rguenth at gcc dot gnu.org
  2021-06-18 11:33 ` [Bug tree-optimization/101120] " rguenth at gcc dot gnu.org
  2021-06-18 12:06 ` rguenth at gcc dot gnu.org
@ 2021-06-21 13:02 ` cvs-commit at gcc dot gnu.org
  2021-06-21 13:03 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-21 13:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:0ad9c7087ef3904da89f2db6007b6d28b116087f

commit r12-1699-g0ad9c7087ef3904da89f2db6007b6d28b116087f
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jun 18 14:07:00 2021 +0200

    tree-optimization/101120 - fix compile-time issue with SLP groups

    This places two hacks to avoid an old compile-time issue when
    vectorizing large permuted SLP groups with gaps where we end up
    emitting loads and IV adjustments for the gap as well and those
    have quite a high cost until they are eventually cleaned up.

    The first hack is to fold the auto-inc style IV updates early
    in the vectorizer rather than in the next forwprop pass which
    shortens the SSA use-def chains of the used IV.

    The second hack is to remove the unused loads after we've picked
    all that we possibly use.

    2021-06-18  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/101120
            * tree-vect-data-refs.c (bump_vector_ptr): Fold the
            built increment.
            * tree-vect-slp.c (vect_transform_slp_perm_load): Add
            DR chain DCE capability.
            * tree-vectorizer.h (vect_transform_slp_perm_load): Adjust.
            * tree-vect-stmts.c (vectorizable_load): Remove unused
            loads in the DR chain for SLP.

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

* [Bug tree-optimization/101120] vn_reference_maybe_forwprop_address can take much compile-time
  2021-06-18 11:33 [Bug tree-optimization/101120] New: vn_reference_maybe_forwprop_address can take much compile-time rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-06-21 13:02 ` cvs-commit at gcc dot gnu.org
@ 2021-06-21 13:03 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-21 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-06-21 13:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 11:33 [Bug tree-optimization/101120] New: vn_reference_maybe_forwprop_address can take much compile-time rguenth at gcc dot gnu.org
2021-06-18 11:33 ` [Bug tree-optimization/101120] " rguenth at gcc dot gnu.org
2021-06-18 12:06 ` rguenth at gcc dot gnu.org
2021-06-21 13:02 ` cvs-commit at gcc dot gnu.org
2021-06-21 13:03 ` rguenth at gcc dot gnu.org

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).