Re: Ping / update: Re: RFA: hookize ADJUST_INSN_LENGTH

2012-11-24 Thread Joern Rennecke
Quoting Joern Rennecke : Quoting Richard Sandiford : 1) As Richard B says, having "locked lengths" with the comment "care must be taken to avoid cycles" doesn't sound like good design. So the question was: without this, why would the length be going up and down "arbitrarily", even thou

Re: Ping / update: Re: RFA: hookize ADJUST_INSN_LENGTH

2012-11-24 Thread Joern Rennecke
Quoting Richard Sandiford : [responding because you kept me on cc:] Joern Rennecke writes: This uses the same interface as my previous patch: http://gcc.gnu.org/ml/gcc-patches/2012-11/msg00473.html , but I refined the algorithm for the get_insn_variants mechanism to work properly with the rew

Re: Ping / update: Re: RFA: hookize ADJUST_INSN_LENGTH

2012-11-24 Thread Richard Sandiford
[responding because you kept me on cc:] Joern Rennecke writes: > This uses the same interface as my previous patch: > http://gcc.gnu.org/ml/gcc-patches/2012-11/msg00473.html , > but I refined the algorithm for the get_insn_variants > mechanism to work properly with the reworked ARC port - > http:

Ping / update: Re: RFA: hookize ADJUST_INSN_LENGTH

2012-11-22 Thread Joern Rennecke
This uses the same interface as my previous patch: http://gcc.gnu.org/ml/gcc-patches/2012-11/msg00473.html , but I refined the algorithm for the get_insn_variants mechanism to work properly with the reworked ARC port - http://gcc.gnu.org/ml/gcc-patches/2012-11/msg01891.html - the only user so far,

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-11-07 Thread Joern Rennecke
Quoting Joern Rennecke : + varying_length[uid] = (varying_length[inner_uid] & 1); Typo; I meant: + varying_length[uid] |= (varying_length[inner_uid] & 1);

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-11-04 Thread amylaar
Quoting Joern Rennecke : The return value is a pointer to a function, to be used for adjusting instruction length in the place of ADJUST_INSN_LENGTHS - and where it is missing, or zero if no such functionis required. (I first thought of having separate target hooks for everything, but then I re

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-11-03 Thread Joern Rennecke
Quoting Richard Sandiford : Joern Rennecke writes: So, if we want to go with a declarative approach, each instruction can have a plurality of variants, each described by a size, an instruction fetch alignment base, an instruction fetch alignment offset set, a cache line base, a cache lin

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-11-01 Thread Joern Rennecke
Quoting Richard Sandiford : > But I think extending the FSM from just being an on-the-fly transformatino during final (as for ARM) to something that happens earlier is a pretty major step in terms of the interface between the backend and the rest of GCC. There are then undocumented restriction

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-11-01 Thread Richard Sandiford
Joern Rennecke writes: > Quoting Richard Sandiford : > >> But what I'm trying to get at is: why can't the backend tell >> shorten_branches about the amount of alignment/misalignment >> that the target wants, and where? Via an attribute or a hook, >> I don't mind which. But it should be declarati

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-10-31 Thread Joern Rennecke
Quoting Richard Sandiford : But what I'm trying to get at is: why can't the backend tell shorten_branches about the amount of alignment/misalignment that the target wants, and where? Via an attribute or a hook, I don't mind which. But it should be declarative, rather than a part of the shorten

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-10-31 Thread Richard Sandiford
Joern Rennecke writes: > Quoting Richard Sandiford : >>> The length variation for the ARC are not alike: there are branches that >>> are subject to branch shortening in the usual way, but they might >>> shrink when other things shrink. When we are iterating starting at >>> minimal length and incr

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-10-31 Thread Joern Rennecke
Quoting Richard Biener : On Wed, Oct 31, 2012 at 2:06 PM, Joern Rennecke wrote: Quoting Richard Biener : Maybe we should split the thing then into a adjust_insn_length attribute without the iteration parameter Attributes don't get any parameter but the instruction, and don't apply to dela

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-10-31 Thread Richard Biener
On Wed, Oct 31, 2012 at 2:06 PM, Joern Rennecke wrote: > Quoting Richard Biener : > >> Maybe we should split the thing then into a adjust_insn_length attribute >> without the iteration parameter > > > Attributes don't get any parameter but the instruction, and don't apply > to delay slot SEQUENCEs

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-10-31 Thread Joern Rennecke
Quoting Richard Biener : Maybe we should split the thing then into a adjust_insn_length attribute without the iteration parameter Attributes don't get any parameter but the instruction, and don't apply to delay slot SEQUENCEs.

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-10-31 Thread Richard Biener
On Wed, Oct 31, 2012 at 1:33 PM, Joern Rennecke wrote: > Quoting Richard Sandiford : > >>> It's about describing complex interactions of length adjustments that >>> derive from branch shortening and length added for (un)alignment for >>> scheduling purposes. Expressed naively, these can lead to c

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-10-31 Thread Joern Rennecke
Quoting Richard Sandiford : It's about describing complex interactions of length adjustments that derive from branch shortening and length added for (un)alignment for scheduling purposes. Expressed naively, these can lead to cycles. But shorten_branches should be written to avoid cycles, and

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-10-31 Thread Richard Sandiford
Joern Rennecke writes: > Quoting Richard Sandiford : >> I should probably have piped up earlier, but I'm really not sure about it. >> ADJUST_INSN_LENGTH as defined now is telling us a property of the target. >> The patch instead ties the new hook directly into the shorten_branches >> algorithm, wh

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-10-31 Thread Joern Rennecke
Quoting Richard Sandiford : I should probably have piped up earlier, but I'm really not sure about it. ADJUST_INSN_LENGTH as defined now is telling us a property of the target. The patch instead ties the new hook directly into the shorten_branches algorithm, which I think is a bad idea. IMO, th

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-10-31 Thread Richard Biener
On Wed, Oct 31, 2012 at 11:22 AM, Richard Sandiford wrote: > Richard Biener writes: >> On Tue, Oct 30, 2012 at 5:14 PM, Joern Rennecke >> wrote: >>> Quoting Richard Biener : >>> Apart from the iteration_threshold the hookization would be straight-forward. Now I cannot decipher fro

Re: RFA: hookize ADJUST_INSN_LENGTH

2012-10-31 Thread Richard Sandiford
Richard Biener writes: > On Tue, Oct 30, 2012 at 5:14 PM, Joern Rennecke > wrote: >> Quoting Richard Biener : >> >>> Apart from the iteration_threshold the hookization would be >>> straight-forward. >>> Now I cannot decipher from the patch what functional change it introduces >>> ;) >> >> >> The

Re: RFA: hookize ADJUST_INSN_LENGTH (Was: RFA: Add lock_lenth attribute to support the ARC port)

2012-10-31 Thread Richard Biener
On Tue, Oct 30, 2012 at 5:14 PM, Joern Rennecke wrote: > Quoting Richard Biener : > >> Apart from the iteration_threshold the hookization would be >> straight-forward. >> Now I cannot decipher from the patch what functional change it introduces >> ;) > > > The only change occurs if we reach an ite

Re: RFA: hookize ADJUST_INSN_LENGTH (Was: RFA: Add lock_lenth attribute to support the ARC port)

2012-10-30 Thread Joern Rennecke
Quoting Richard Biener : Apart from the iteration_threshold the hookization would be straight-forward. Now I cannot decipher from the patch what functional change it introduces ;) The only change occurs if we reach an iteration count of MAX_INT iterations - which should already be indicative o

Re: RFA: hookize ADJUST_INSN_LENGTH (Was: RFA: Add lock_lenth attribute to support the ARC port)

2012-10-30 Thread Richard Biener
On Sun, Oct 28, 2012 at 6:13 PM, Joern Rennecke wrote: > Quoting Richard Biener : > >>> Thus, you can allow the length to vary downwards as well as upwards >>> across iterations with suitable definitions of the @code{length} >>> attribute >>> and/or @code{ADJUST_INSN_LENGTH}. Care has to be taken

RFA: hookize ADJUST_INSN_LENGTH (Was: RFA: Add lock_lenth attribute to support the ARC port)

2012-10-28 Thread Joern Rennecke
Quoting Richard Biener : Thus, you can allow the length to vary downwards as well as upwards across iterations with suitable definitions of the @code{length} attribute and/or @code{ADJUST_INSN_LENGTH}. Care has to be taken that this does not lead to infinite loops. I don't see that you can sh