This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: req. help on merging instructions
- From: Uros Bizjak <uros dot bizjak at kss-loka dot si>
- To: mohit dot sharma at bpltelecom dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 15 Jun 2005 08:23:17 +0200
- Subject: Re: req. help on merging instructions
Hello!
> Iam trying to merge the following two instructions
> 1. addu r2, r3,r4
> 2. ld r5 ,mem(r2) # load from address calculated
> in the prev. instruction
> in to one single isntruction.
> 3. ldx r5 , mem(r3(r4)) # indexed load.
> I managed to do it with a define_peephole pattern
> in the md file. But I want this to happen only in the case
> when the last use of register r2 is in statement2 (i.e it isn't
> live after stmt 2.)otherwise the r2 value would go incorrect
You could use peep2_reg_dead_p() or peep2_regno_dead_p() functions in
define_peephole constraints. There are many examples of their use in i386.md.
Uros.