This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Modulo-scheduling improvements. Patch 2 of 2. (re-submission)
- From: trevor_smigiel at playstation dot sony dot com
- To: Revital1 Eres <ERES at il dot ibm dot com>
- Cc: abel at ispras dot ru, andrew_pinski at playstation dot sony dot com, Ayal Zaks <ZAKS at il dot ibm dot com>, dje at watson dot ibm dot com, gcc-patches at gcc dot gnu dot org, Mircea Namolaru <NAMOLARU at il dot ibm dot com>, Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- Date: Tue, 28 Aug 2007 11:29:37 -0700
- Subject: Re: [PATCH] Modulo-scheduling improvements. Patch 2 of 2. (re-submission)
- References: <20070827184958.GA1923@playstation.sony.com> <OF2B9DD7BC.51E2F03C-ONC2257345.002324D6-C2257345.00259AC2@il.ibm.com>
Revital,
Sorry I didn't notice this before, but shouldn't there be a FAIL at the
end of the doloop_end pattern?
Trevor
> + ;; Define the subtract-one-and-jump insns so loop.c
> + ;; knows what to generate.
> + (define_expand "doloop_end"
> + [(use (match_operand 0 "" "")) ; loop pseudo
> + (use (match_operand 1 "" "")) ; iterations; zero if unknown
> + (use (match_operand 2 "" "")) ; max iterations
> + (use (match_operand 3 "" "")) ; loop level
> + (use (match_operand 4 "" ""))] ; label
> + ""
> + "
> + {
> + /* Currently SMS relies on the do-loop pattern to recognize loops
> + where (1) the control part comprises of all insns defining and/or
> + using a certain 'count' register and (2) the loop count can be
> + adjusted by modifying this register prior to the loop.
> +. ??? The possible introduction of a new block to initialize the
> + new IV can potentially effects branch optimizations. */
> + if (optimize > 0 && flag_modulo_sched)
> + {
> + rtx s0;
> + rtx bcomp;
> + rtx loc_ref;
> +
> + /* Only use this on innermost loops. */
> + if (INTVAL (operands[3]) > 1)
> + FAIL;
> + if (GET_MODE (operands[0]) != SImode)
> + FAIL;
> +
> + s0 = operands [0];
> + emit_move_insn (s0, gen_rtx_PLUS (SImode, s0, GEN_INT (-1)));
> + bcomp = gen_rtx_NE(SImode, s0, const0_rtx);
> + loc_ref = gen_rtx_LABEL_REF (VOIDmode, operands [4]);
> + emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
> + gen_rtx_IF_THEN_ELSE (VOIDmode, bcomp,
> + loc_ref, pc_rtx)));
> +
> + DONE;
> + }
FAIL;
> + }")
> +