This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][4.4] PR rtl-optimization/3507 appalling optimization with sub/cmp


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]