This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: sched-deps speedup
- To: Richard Henderson <rth at redhat dot com>, Rod Stewart <stewart at lab43 dot org>, gcc-patches at gcc dot gnu dot org
- Subject: Re: sched-deps speedup
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Thu, 11 Jan 2001 17:54:01 +0000
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
I've looked into this a bit further. What we have during factor_tests
with the input
{dup=1} 9 n -1 a -1
{code=const_int + elt0_w=4} 10 n 27 a -1
{code=set} 11 n -1 a -1
{mode=SI + code=reg + pred=(arm_hard_register_operand,SI) + A_op=4}
12 n -1 a -1
{mode=SI + code=mem} 13 n -1 a -1
{mode=SI + code=plus} 14 n -1 a -1
{dup=1} 15 n -1 a -1
{code=const_int + elt0_w=8 + c_test="TARGET_ARM && XV..." +
A_insn=(0,0)} 16 n -1 a -1
{code=const_int + elt0_w=4 + c_test="TARGET_ARM && XV..." +
A_insn=(1,0)} 27 n -1 a -1
This is factored at the const_int nodes, giving:
(gdb) call debug_decision(oldh->first)
{code=const_int} 10 n -1 a -1
{elt0_w=4} 28 n -1 a -1
{code=set} 11 n -1 a -1
{mode=SI + code=reg + pred=(arm_hard_register_operand,SI) + A_op=4}
12 n -1 a -1
{mode=SI + code=mem} 13 n -1 a -1
{mode=SI + code=plus} 14 n -1 a -1
{dup=1} 15 n -1 a -1
{code=const_int + elt0_w=8 + c_test="TARGET_ARM && XV..." +
A_insn=(0,0)} 16 n -1 a -1
(gdb) call debug_decision(addh->first)
{code=const_int} 27 n -1 a -1
{elt0_w=4 + c_test="TARGET_ARM && XV..." + A_insn=(1,0)} 29 n -1 a -1
On which we then call merge_trees. Unfortunately, merge_trees does not
find the two elt0_w=4 nodes to be the same, so it fails to merge them and
settles on
{code=const_int} 10 n -1 a -1
{elt0_w=4} 28 n 29 a -1
{code=set} 11 n -1 a -1
{mode=SI + code=reg + pred=(arm_hard_register_operand,SI) +
A_op=4} 12 n -1 a -1
{mode=SI + code=mem} 13 n -1 a -1
{mode=SI + code=plus} 14 n -1 a -1
{dup=1} 15 n -1 a -1
{code=const_int + elt0_w=8 + c_test="TARGET_ARM && XV..."
+ A_insn=(0,0)} 16 n -1 a -1
{elt0_w=4 + c_test="TARGET_ARM && XV..." + A_insn=(1,0)} 29 n -1 a -1
as the simplified tree. When it then comes to emitting the output we then
generate a switch with two identical values.
I'm not sure how best to fix it. I think that somehow we need to make
merge_trees find the common values and split the decision graph at a lower
layer.
Any suggestions?
R.