http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59239

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #0)
> Created attachment 31264 [details]
> Possible cleanup patch

After applying the patch and replacing the "doloop_end" expander with

(define_expand "doloop_end"
  [(use (match_operand:SI 0 "arith_reg_dest"))  ; loop count pseudo
   (use (match_operand 1))]                     ; label
  "TARGET_SH2"
{
  emit_insn (gen_dect (operands[0], operands[0]));
  emit_jump_insn (gen_branch_false (operands[1]));
  DONE;
})

will expose the individual decrement-and-test and cbranch insns early.  This
shows quite some changes in the CSiBE set.  The decrement-and-test insn will be
used less frequently and there are some code size increases with the worst case
being

src/nrrd/convertNrrd         4868 -> 5240        +372 / +7.641742 %

On the other hand, it causes an overall code size decrease of -3944 bytes on
the whole CSiBE set with some of the highlights being

teem-1.6.0-src  src/nrrd/tmfKernel  132652 -> 131520  -1132 / -0.853361 %
mpeg2dec-0.3.1  libmpeg2/decode     2820 -> 2620      -200 / -7.092199 %

it looks like fewer registers are used and some loop counter setup calculations
are smaller.

Reply via email to