This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC][4.4] PR rtl-optimization/3507 appalling optimization with sub/cmp
- From: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: GCC Patches R <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 29 Nov 2007 14:53:20 +0100
- Subject: Re: [RFC][4.4] PR rtl-optimization/3507 appalling optimization with sub/cmp
- References: <20071128185122.GG17368@sygehus.dk> <474EA55D.9040507@gnu.org>
On Thu, Nov 29, 2007 at 12:41:17PM +0100, Paolo Bonzini wrote:
>
> > (cse_main): Ask DF for def-use chains.
>
> I'm not sure I like using def-use chains in CSE. The pass works in
> completely different ways. For example we already have
> find_comparison_args doing the reverse of def-use chains.
cse_find_comparison_use() can be written without def-use chains; I'll do
that. Def-use chains are just the cleanest way of getting that information.
> Second, and more important, the optimization belongs in fold_rtx,
The detail is that I need to know DEST, which isn't passed to fold_rtx.
That can be changed, ofcourse.
> and could use find_comparison_args+lookup to extract the information it
> needs.
I already have the comparison args, that's the easy bit. We have
(insn 1 (set (reg C) (minus (reg A) (reg B))))
(insn 2 (set (reg D) (compare (reg A) (reg B))))
(insn 3 (set ... (ltu (reg D) (const_int 0))))
and want to reuse C in insn 2:
(insn 2 (set (reg D) (compare (reg A) (reg C))))
The comparison args are just XEXP (src, 0) and XEXP (src, 1). How does
find_comparison_args() help?
--
Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a year