This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: sched-deps speedup



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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]