This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFC: PR gcc/1532
- From: Richard Henderson <rth at redhat dot com>
- To: Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 22 Jan 2004 13:43:35 -0800
- Subject: Re: PATCH RFC: PR gcc/1532
- References: <20040122150937.18924.qmail@gossamer.airs.com>
On Thu, Jan 22, 2004 at 10:09:37AM -0500, Ian Lance Taylor wrote:
> * Perhaps the macros should be in the target vector instead?
Please.
> So at the moment the pass runs in CSE after loop. That doesn't make
> a lot of sense. But I'm not sure where else to plug it in.
I would at least call it from rest_of_handle_cse2, rather than
hiding it inside cse_main.
> +static void
> +cse_change_flag_mode (unsigned int regno, enum machine_mode mode, rtx x,
> + rtx newreg)
Please just use for_each_rtx.
> +/* Change the mode of any reference to the register REGNO to MODE,
> + starting at INSN. If END is set, stop before that insn.
> + Otherwise, keep going until a CODE_LABEL or an instruction which
> + changes REGNO. NEWREG is a version of the REG with the right
> + mode. */
> +
> +static void
> +cse_change_flag_mode_insns (unsigned int regno, enum machine_mode mode,
> + rtx insn, rtx end, rtx newreg)
Do you really need to scan all insns, rather than knowing the one or
two that the register is actually in?
> + for (insn = f; insn; insn = next)
I'd prefer we scan by blocks, so you can follow the extended basic block,
rather than just recognizing CODE_LABELs.
Also, do you actually see this useful all the way through a block? I
suppose we may have flags users in conditional moves and the like, but
I'm thinking the flags register gets killed too often to be useful,
and within a block (e.g. for conditional move) I would think that cse
already does a decent job.
I'm thinking you can scan much fewer insns than the whole function if:
(1) you examine the end of the block for a flags setter and
(2) scan the head of the single-source successors for flags users,
and stop when you see the flags register clobbered.
r~