This is the mail archive of the 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]
Other format: [Raw text]

Re: Problem with peephole to peephole2 conversion

On Wed, Aug 24, 2005 at 06:50:25PM +0530, Ashwin wrote:
> The pattern matches in the original peephole pass because the 
> peephole pass happens just before assembly generation, when the 3 insns 
> are present together.  Has anybody encountered a similar problem?

No, or at least havn't looked.

> Does this mean that peephole2 and peephole both should be kept on.

No.  It would be possible to run peep2 more than once.
Noone has shown a need for it yet.

> Secondly, after taking a look at other ports, i realised that all are 
> using peep2_dead_reg_p instead of dead_or_set_p to check if a register 
> is dead. The former is smarter than the later in the sense that it also 
> checks if the current insn "sets" the register which is to be verified 
> as dead. So, why do other ports use peep2_reg_dead_p instead of 
> dead_or_set_p. Pls help me to find the advantages of using 
> peep2_reg_dead_p over its counterpart.

My guess is that your misunderstanding is that you're not
realizing that you can ask peep2_dead_reg_p about the 
state of a register at the beginning of the N+1 insn in
the sequence.  That is, after the entire sequence is over.

peep2_dead_reg_p *is* smarter than dead_or_set_p.


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