This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: About Loop Pattern ----GCC porting
- From: Ian Lance Taylor <iant at google dot com>
- To: "redriver jiang" <jiangpeople at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 01 Mar 2007 09:55:01 -0800
- Subject: Re: About Loop Pattern ----GCC porting
- References: <338f53fb0703010429j58f0e058sc86e62f6d33f9652@mail.gmail.com> <338f53fb0703010435r507309a8r768f2e9fe9edf37e@mail.gmail.com>
"redriver jiang" <jiangpeople@gmail.com> writes:
> I am Jiang Hongjiang and recently I am porting the GCC backend
> to a DSP, and get puzzled about the "decrement_and_branch_until_zero"
> pattern.By Reading the GCC source, I find that this pattern is used in
> loop optimization, and it's used under the condition of defining the
> "doloop_end" pattern. Inspired by the c4x machine description file(
> c4x.md), I defined the "doloop_end" pattern using "define_expand", and
> generate the "decrement_and_branch_until_zero" insn in the preparation
> statements. Right now the GCC can generate the
> "decrement_and_branch_until_zero" insns and its related assemble
> insn(in my platform it is "DJNZ Rn,lable"), but I find that the GCC
> remains other insns(the cmp insns and other) unchanged. How do you
> delete the "CMP" insn and other insn in the loop while using the
> "decrement_and_branch_until_zero" pattern? The accessory demonstrates
> a example.
Normally the compare instruction is removed later because it is
unused: it is nonvolatile and nothing uses the result. You must
determine why the compiler thinks that the compare instruction is
still used.
Ian