* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
@ 2011-07-14 19:23 ` wschmidt at gcc dot gnu.org
2011-07-14 19:23 ` wschmidt at gcc dot gnu.org
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-14 19:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #2 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-14 19:23:29 UTC ---
Created attachment 24761
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24761
Gimple following reassoc2 with TARGET_MEM_REFs
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
2011-07-14 19:23 ` [Bug tree-optimization/49749] " wschmidt at gcc dot gnu.org
@ 2011-07-14 19:23 ` wschmidt at gcc dot gnu.org
2011-07-14 19:27 ` wschmidt at gcc dot gnu.org
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-14 19:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #1 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-14 19:22:08 UTC ---
Created attachment 24760
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24760
Gimple prior to reassoc2
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
2011-07-14 19:23 ` [Bug tree-optimization/49749] " wschmidt at gcc dot gnu.org
2011-07-14 19:23 ` wschmidt at gcc dot gnu.org
@ 2011-07-14 19:27 ` wschmidt at gcc dot gnu.org
2011-07-14 19:28 ` wschmidt at gcc dot gnu.org
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-14 19:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #5 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-14 19:25:51 UTC ---
Created attachment 24764
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24764
Gimple prior to expand, r161840
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (2 preceding siblings ...)
2011-07-14 19:27 ` wschmidt at gcc dot gnu.org
@ 2011-07-14 19:28 ` wschmidt at gcc dot gnu.org
2011-07-14 19:30 ` wschmidt at gcc dot gnu.org
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-14 19:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #4 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-14 19:25:18 UTC ---
Created attachment 24763
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24763
Gimple prior to expand, r161839
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (3 preceding siblings ...)
2011-07-14 19:28 ` wschmidt at gcc dot gnu.org
@ 2011-07-14 19:30 ` wschmidt at gcc dot gnu.org
2011-07-15 20:16 ` wschmidt at gcc dot gnu.org
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-14 19:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #3 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-14 19:24:19 UTC ---
Created attachment 24762
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24762
Gimple following reassoc2 with MEM_REFs
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (4 preceding siblings ...)
2011-07-14 19:30 ` wschmidt at gcc dot gnu.org
@ 2011-07-15 20:16 ` wschmidt at gcc dot gnu.org
2011-07-15 20:21 ` wschmidt at gcc dot gnu.org
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-15 20:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #6 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-15 20:15:09 UTC ---
We ran some experiments attempting to restore the r161839 behavior, either by
lowering the rank of memory references or raising the rank of phi references.
Although both experiments restored bwaves code generation to respectability,
several other benchmarks suffered, so this is not a general answer. Any
thoughts on more limited heuristics that might help the bwaves scenario?
It seems that copyrename needs help from reassoc to find the opportunity;
perhaps reassoc can be tweaked to recognize situations that will help
copyrename downstream?
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (5 preceding siblings ...)
2011-07-15 20:16 ` wschmidt at gcc dot gnu.org
@ 2011-07-15 20:21 ` wschmidt at gcc dot gnu.org
2011-07-18 9:11 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-15 20:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #7 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-15 20:19:21 UTC ---
Our experiments didn't distinguish between loop-carried PHIs and other join
points, so that might be another avenue of attack.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (6 preceding siblings ...)
2011-07-15 20:21 ` wschmidt at gcc dot gnu.org
@ 2011-07-18 9:11 ` rguenth at gcc dot gnu.org
2011-07-20 16:30 ` wschmidt at gcc dot gnu.org
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-07-18 9:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.07.18 09:07:11
Ever Confirmed|0 |1
--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-18 09:07:11 UTC ---
First of call, confirmed.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (7 preceding siblings ...)
2011-07-18 9:11 ` rguenth at gcc dot gnu.org
@ 2011-07-20 16:30 ` wschmidt at gcc dot gnu.org
2011-07-20 16:39 ` wschmidt at gcc dot gnu.org
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-20 16:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
William J. Schmidt <wschmidt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |wschmidt at gcc dot gnu.org
|gnu.org |
--- Comment #9 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-20 16:28:49 UTC ---
Created attachment 24798
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24798
Proposed patch
I'm attaching a patch that solves this issue. The patch was produced against
the ibm/gcc-4_6-branch, but should apply OK to trunk -- I'll verify that later
if the direction of this patch is acceptable. This regains the 20% performance
loss we had experienced in 410.bwaves, and also gives a 5% boost to 444.namd.
No significant degradations were observed on SPEC cpu2006.
In addition to fixing the operand access problems, the patch looks for
loop-carried dependencies in innermost loops, and biases the reassociation so
that the phi target is summed last. The purpose of this is to identify
accumulator variables in inner loops and make each iteration of their
accumulations independent. When these loops are unrolled, multiple independent
iterations can be interleaved for improved performance.
The optimization is restricted to innermost loops to avoid unnecessarily
raising register pressure.
There may be a better way to achieve the bias than what I've chosen here, so
please comment. If the general approach is acceptable, I'll apply comments and
submit the patch for approval.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (8 preceding siblings ...)
2011-07-20 16:30 ` wschmidt at gcc dot gnu.org
@ 2011-07-20 16:39 ` wschmidt at gcc dot gnu.org
2011-07-20 19:02 ` wschmidt at gcc dot gnu.org
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-20 16:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #10 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-20 16:39:26 UTC ---
Created attachment 24799
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24799
The real proposed patch
Oh, for Pete's sake. I attached the wrong patch. Here's the right one.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (9 preceding siblings ...)
2011-07-20 16:39 ` wschmidt at gcc dot gnu.org
@ 2011-07-20 19:02 ` wschmidt at gcc dot gnu.org
2011-07-21 12:07 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-20 19:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #11 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-20 19:01:30 UTC ---
I forgot to mention some justification for the value of PHI_LOOP_BIAS, and I
notice it has a misleading comment by it at the moment. The value is a
constant that should be larger than the depth of the largest expected
reassociation tree, but generally smaller than twice the rank of the basic
block. The intent is to limit the effect to single-block loops for now. One
of the questions I have is whether the bias should be allowed for more complex
innermost loops.
PHI_LOOP_BIAS is a crude method and something more refined is probably needed,
but it serves to demonstrate the viability of the general approach.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (10 preceding siblings ...)
2011-07-20 19:02 ` wschmidt at gcc dot gnu.org
@ 2011-07-21 12:07 ` rguenth at gcc dot gnu.org
2011-07-21 18:09 ` wschmidt at gcc dot gnu.org
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-07-21 12:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #12 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-21 12:04:01 UTC ---
+ tree arg = gimple_phi_arg (stmt, i)->def;
+ if (TREE_CODE (arg) == SSA_NAME)
+ {
+ gimple def_stmt = SSA_NAME_DEF_STMT (arg);
+ if (def_stmt
+ && gimple_bb (def_stmt)
arg = gimple_phi_arg_def (stmt, i);
if (TREE_CODE (arg) == SSA_NAME
&& !SSA_NAME_IS_DEFAULT_DEF (arg))
{
gimple def_stmt = SSA_NAME_DEF_STMT (arg);
...
without the def_stmt != NULL and gimple_bb != NULL check.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (11 preceding siblings ...)
2011-07-21 12:07 ` rguenth at gcc dot gnu.org
@ 2011-07-21 18:09 ` wschmidt at gcc dot gnu.org
2011-07-21 20:28 ` wschmidt at gcc dot gnu.org
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-21 18:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #13 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-21 18:07:42 UTC ---
Author: wschmidt
Date: Thu Jul 21 18:07:39 2011
New Revision: 176581
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176581
Log:
2011-07-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/49749
* tree-ssa-reassoc.c (get_rank): Fix operand scan conditions and
remove no-longer-used maxrank variable.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-reassoc.c
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (12 preceding siblings ...)
2011-07-21 18:09 ` wschmidt at gcc dot gnu.org
@ 2011-07-21 20:28 ` wschmidt at gcc dot gnu.org
2011-07-29 18:41 ` wschmidt at gcc dot gnu.org
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-21 20:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #14 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-21 20:27:21 UTC ---
Author: wschmidt
Date: Thu Jul 21 20:27:17 2011
New Revision: 176585
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176585
Log:
2011-07-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/49749
* tree-ssa-reassoc.c (PHI_LOOP_BIAS): New constant.
(phi_loop_bias): New function.
(get_rank): Bias rank upward for loop-carried dependencies; fix
errors in operand scan conditions.
Modified:
branches/ibm/gcc-4_6-branch/gcc/ChangeLog.ibm
branches/ibm/gcc-4_6-branch/gcc/tree-ssa-reassoc.c
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (13 preceding siblings ...)
2011-07-21 20:28 ` wschmidt at gcc dot gnu.org
@ 2011-07-29 18:41 ` wschmidt at gcc dot gnu.org
2011-07-31 19:00 ` wschmidt at gcc dot gnu.org
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-29 18:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #15 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-29 18:40:26 UTC ---
Author: wschmidt
Date: Fri Jul 29 18:40:21 2011
New Revision: 176948
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176948
Log:
2011-07-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/49749
* tree-ssa-reassoc.c (get_rank): New forward declaration.
(PHI_LOOP_BIAS): Changed value.
(phi_loop_bias): Replaced with...
(phi_rank): ...this new function.
(loop_carried_phi): New function.
(propagate_rank): Likewise.
(get_rank): Replace loop-biasing expression with call to phi_rank;
remove variable maxrank; replace propagation logic with calls to
propagate_rank.
Modified:
branches/ibm/gcc-4_6-branch/gcc/ChangeLog.ibm
branches/ibm/gcc-4_6-branch/gcc/tree-ssa-reassoc.c
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (14 preceding siblings ...)
2011-07-29 18:41 ` wschmidt at gcc dot gnu.org
@ 2011-07-31 19:00 ` wschmidt at gcc dot gnu.org
2011-07-31 19:01 ` wschmidt at gcc dot gnu.org
2021-09-28 12:11 ` cvs-commit at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-31 19:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #16 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-31 18:58:09 UTC ---
Author: wschmidt
Date: Sun Jul 31 18:58:06 2011
New Revision: 176984
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176984
Log:
2011-07-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/49749
* tree-ssa-reassoc.c (get_rank): New forward declaration.
(PHI_LOOP_BIAS): New macro.
(phi_rank): New function.
(loop_carried_phi): Likewise.
(propagate_rank): Likewise.
(get_rank): Add calls to phi_rank and propagate_rank.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-reassoc.c
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (15 preceding siblings ...)
2011-07-31 19:00 ` wschmidt at gcc dot gnu.org
@ 2011-07-31 19:01 ` wschmidt at gcc dot gnu.org
2021-09-28 12:11 ` cvs-commit at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2011-07-31 19:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
William J. Schmidt <wschmidt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #17 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-31 19:01:05 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/49749] Reassociation rank algorithm does not include all non-NULL operands
2011-07-14 16:51 [Bug tree-optimization/49749] New: Reassociation rank algorithm does not include all non-NULL operands wschmidt at gcc dot gnu.org
` (16 preceding siblings ...)
2011-07-31 19:01 ` wschmidt at gcc dot gnu.org
@ 2021-09-28 12:11 ` cvs-commit at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-28 12:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749
--- Comment #18 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Ilya Leoshkevich <iii@gcc.gnu.org>:
https://gcc.gnu.org/g:dbed1c8693c6b5cb02c903cea91db574200bd513
commit r12-3922-gdbed1c8693c6b5cb02c903cea91db574200bd513
Author: Ilya Leoshkevich <iii@linux.ibm.com>
Date: Wed Jun 24 01:30:47 2020 +0200
reassoc: Propagate PHI_LOOP_BIAS along single uses
PR tree-optimization/49749 introduced code that shortens dependency
chains containing loop accumulators by placing them last on operand
lists of associative operations.
456.hmmer benchmark on s390 could benefit from this, however, the code
that needs it modifies loop accumulator before using it, and since only
so-called loop-carried phis are are treated as loop accumulators, the
code in the present form doesn't really help. According to Bill
Schmidt - the original author - such a conservative approach was chosen
so as to avoid unnecessarily swapping operands, which might cause
unpredictable effects. However, giving special treatment to forms of
loop accumulators is acceptable.
The definition of loop-carried phi is: it's a single-use phi, which is
used in the same innermost loop it's defined in, at least one argument
of which is defined in the same innermost loop as the phi itself.
Given this, it seems natural to treat single uses of such phis as phis
themselves.
gcc/ChangeLog:
* tree-ssa-reassoc.c (biased_names): New global.
(propagate_bias_p): New function.
(loop_carried_phi): Remove.
(propagate_rank): Propagate bias along single uses.
(get_rank): Update biased_names when needed.
^ permalink raw reply [flat|nested] 19+ messages in thread