This is the mail archive of the
mailing list for the GCC project.
Re: Problem with peephole to peephole2 conversion
- From: Richard Henderson <rth at redhat dot com>
- To: Ashwin <ashwin at codito dot com>
- Cc: gcc at gcc dot gnu dot org, abhijit at codito dot com, pranav at codito dot com, ramana at codito dot com, saurabh dot verma at codito dot com
- Date: Wed, 24 Aug 2005 10:06:39 -0700
- Subject: Re: Problem with peephole to peephole2 conversion
- References: <430C7419.firstname.lastname@example.org>
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.