avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] avr_rtx_cost for DImode values?


From: Senthil Kumar Selvaraj
Subject: Re: [avr-gcc-list] avr_rtx_cost for DImode values?
Date: Wed, 19 Mar 2014 22:06:44 +0530
User-agent: Mutt/1.5.22 (2013-10-16)

On Wed, Mar 19, 2014 at 03:50:47PM +0100, Georg-Johann Lay wrote:
> Am 03/18/2014 06:33 PM, schrieb Senthil Kumar Selvaraj:
> >Hi,
> >
> >I see that the avr_rtx_costs_1 function returns relative costs for a
> >variety of RTL codes, but only for non-DImode operands. For DImode,
> >it returns false, and gcc uses its idea of the cost plus the costs of
> >operands (found by recursing into the RTL expression) instead.
> >
> >Is there a reason why this has not been done?
> >
> >I was trying to debug compilation timeouts in the latest trunk test
> >results (http://gcc.gnu.org/ml/gcc-testresults/2014-03/msg01239.html)
> >- specifically
> >WARNING: program timed out.
> >FAIL: gcc.c-torture/execute/20041011-1.c compilation,  -O1
> 
> I cannot reproduce this all 22 tests from execute.exp=20041011-1.c take
> around 6 seconds (including test suite overhead).
> 
> >and found that expmed.c:choose_mult_variant takes a lot of time to
> >finish if a DImode value of -513 is provided. From my initial
> >analysis, it looks like it has to do with cost values being off for
> >DImode RTL operations (making MULT in avr_rtx_costs_1 to return
> >twice the cost of SImode for DImode fixed the timeout). Has
> >someone seen or fixed something like this before?
> 
> No. Even if the choice of a particular MUL strategy is not optimal, it
> should not hang the compiler.  I suspect you are using a 64-bit host? (I am
> on 32 bit Linux).
> 
That's right - I'm running the compiler on an amd64 machine. I see a
bunch of HOST_WIDE_INTs being used in choose_mult_variant and its
calleesm. -513 is treated as an unsigned HOST_WIDE_INT, and the
(recursive) call stack of synth_mult calls is ~30 frames deep in my
machine (see attached backtrace below).

And oh, the time consuming part is *deciding* on the choice of
algorithm to do the multiplication, not the RTL/code generation part.

Regards
Senthil

avr_rtx_costs[t2:expand(175)]=true (speed) total=0, outer=mult:
(const_int -513 [0xfffffffffffffdff])
^C
Program received signal SIGINT, Interrupt.
0x0000000000715ab0 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2714
2714          if (t % d == 0 && t > d && m < maxm
(gdb) bt
#0  0x0000000000715ab0 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2714
#1  0x0000000000716365 in synth_mult (address@hidden, t=6268037, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2792
#2  0x00000000007160f0 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2734
#3  0x0000000000715798 in synth_mult (address@hidden, t=376082220, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2525
#4  0x0000000000715faa in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2695
#5  0x0000000000715cbf in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2598
#6  0x0000000000716365 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2792
#7  0x0000000000716365 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2792
#8  0x0000000000715798 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2525
#9  0x00000000007159c0 in synth_mult (address@hidden, t=3177142594265, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2618
#10 0x0000000000715faa in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2695
#11 0x0000000000716365 in synth_mult (address@hidden, t=31771425942649, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2792
#12 0x00000000007160f0 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2734
#13 0x0000000000715798 in synth_mult (address@hidden, t=381257111311788, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2525
#14 0x0000000000715faa in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2695
#15 0x00000000007159c0 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2618
#16 0x0000000000716365 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2792
#17 0x0000000000716365 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2792
#18 0x0000000000716365 in synth_mult (address@hidden, t=27450512014448737, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2792
#19 0x00000000007160f0 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2734
#20 0x0000000000716365 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2792
#21 0x0000000000716365 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2792
#22 0x0000000000715798 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2525
#23 0x00000000007159c0 in synth_mult (address@hidden, t=2635249153387078729, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2618
#24 0x00000000007160f0 in synth_mult (address@hidden, address@hidden, 
address@hidden, address@hidden) at /scratch/code/git/gcc/gcc/expmed.c:2734
#25 0x0000000000716523 in choose_mult_variant (address@hidden, address@hidden, 
address@hidden, address@hidden, mult_cost=1280) at 
/scratch/code/git/gcc/gcc/expmed.c:2887
<snip>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]