This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH ARM]Extend thumb1_reorg to save more comparison instructions
- From: "Bin Cheng" <bin dot cheng at arm dot com>
- To: "Richard Earnshaw" <Richard dot Earnshaw at arm dot com>, "Steven Bosscher" <stevenb dot gcc at gmail dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 18 Apr 2013 17:39:24 +0800
- Subject: RE: [PATCH ARM]Extend thumb1_reorg to save more comparison instructions
- References: <516f8681 dot a21d3c0a dot 31cc dot 54d5SMTPIN_ADDED_BROKEN at mx dot google dot com> <CABu31nM8Hc2uf4Jq7hTc5ODY0nNAoDzMOm1mLn9NB4sE7B7iow at mail dot gmail dot com> <516FBBD2 dot 6020308 at arm dot com>
> -----Original Message-----
> From: Richard Earnshaw
> Sent: Thursday, April 18, 2013 5:25 PM
> To: Steven Bosscher
> Cc: Bin Cheng; gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH ARM]Extend thumb1_reorg to save more comparison
> instructions
>
> On 18/04/13 09:20, Steven Bosscher wrote:
> > On Thu, Apr 18, 2013 at 7:34 AM, Bin Cheng wrote:
> >> Hi,
> >> Before thumb1_reorg, ARM backend uses peephole to save comparison
> >> instructions when a flag setting move is found before branch
instruction.
> >> Since we are using thumb1_reog now, it can be extended to catch more
> >> opportunities by searching flag setting move instruction before
> >> branch, rather than only the exact one before branch.
> >> For example:
> >>
> >> mov r0, r1
> >> //other insns does not kill r0
> >> branch if (r0 == 0)
> >> //other insns
> >>
> >> Tested on thumb1, is it OK?
> >
> > Isn't this something you could use compare-elim.c for instead of a
> > target specific pass?
> >
> > Ciao!
> > Steven
> >
>
> I haven't looked at compare-elim, but probably not. Thumb1 doesn't use
> cc1 and doesn't expose flag setting instructions in a MI manner (since add
> instructions clobber the flags). As such it needs private back-end data
to
> work out what's safe.
Yes, so far the pass is disabled on ARM.
I have another question, would it be better for this pass be postponed to
late rtl phase, since it and scheduler (other passes) may meddle with each
other?
Thanks.