This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: CFG branch merge 8 - SMALL_REGISTER_CLASSES versus profiling
- From: Richard Henderson <rth at redhat dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, gcc-pdo at atrey dot karlin dot mff dot cuni dot cz, patches at x86-64 dot org
- Date: Thu, 28 Feb 2002 15:33:04 -0800
- Subject: Re: CFG branch merge 8 - SMALL_REGISTER_CLASSES versus profiling
- References: <20020228203234.GC20347@atrey.karlin.mff.cuni.cz>
On Thu, Feb 28, 2002 at 09:32:34PM +0100, Jan Hubicka wrote:
> ! /* Special case -- avoid inserting code between call and storing
> ! its return value. */
> ! if (watch_calls && (e->flags & EDGE_FALLTHRU) && !e->dest->pred->pred_next)
> ! {
> ! rtx insert_after = e->src->end;
> ! if (insert_after
> ! && SMALL_REGISTER_CLASSES
> ! && GET_CODE (insert_after) == CALL_INSN
> ! && (GET_CODE (PATTERN (insert_after)) == SET
> ! || (GET_CODE (PATTERN (insert_after)) == PARALLEL
> ! && GET_CODE (XVECEXP (PATTERN (insert_after), 0, 0)) ==
> ! SET)))
> ! {
> ! rtx return_reg;
> ! rtx next_insert_after = next_nonnote_insn (insert_after);
> ! rtx set;
> !
> ! /* The first insn after the call may be a stack pop, skip it. */
> ! if (next_insert_after
> ! && GET_CODE (next_insert_after) == INSN
> ! && (set = single_set (next_insert_after))
> ! && GET_CODE (set) == SET
> ! && SET_DEST (set) == stack_pointer_rtx)
> ! next_insert_after = next_nonnote_insn (next_insert_after);
> ! if (next_insert_after && GET_CODE (next_insert_after) == INSN)
> ! {
> ! if (GET_CODE (PATTERN (insert_after)) == SET)
> ! return_reg = SET_DEST (PATTERN (insert_after));
> ! else
> ! return_reg =
> ! SET_DEST (XVECEXP (PATTERN (insert_after), 0, 0));
> !
> ! /* Now, NEXT_INSERT_AFTER may be an instruction that uses the
> ! return value. However, it could also be something else,
> ! like a CODE_LABEL, so check that the code is INSN. */
> ! if (next_insert_after
> ! && GET_CODE (next_insert_after) == INSN
> ! && reg_referenced_p (return_reg,
> ! PATTERN (next_insert_after)))
> ! insert_after = next_insert_after;
I think all this should use keep_with_call_p and not be
dependent on SMALL_REGISTER_CLASSES. As can be seen with
ia64 when you put stuff before the gp reload.
r~