This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: New Regalloc Branch
- From: Denis Chertykov <denisc at overta dot ru>
- To: Erwin Ingris <erwiningris at yahoo dot com dot au>
- Cc: Michael Matz <matz at kde dot org>, gcc at gcc dot gnu dot org
- Date: 30 May 2002 19:18:15 +0400
- Subject: Re: New Regalloc Branch
- References: <20020530120826.67139.qmail@web21503.mail.yahoo.com>
Erwin Ingris <erwiningris@yahoo.com.au> writes:
> Hi,
>
> > The current allocator (which really works in three
> > passes) doesn't work
> > really globally, and the algorithms it uses are
> > failry adhoc. It can't
> > split pseudo registers, or coalesce them (although
> > it has something like
> > preferences to get rid of copies, which is something
> > like coalescing).
> > It doesn't use exact live-ness information to the
> > full extent. And
> > spill-code is inserted by a different pass (reload),
>
> In reg-alloc branch code I am seeing a call to
> reload after reg_alloc.
>
> 3090 if (flag_new_regalloc)
> 3091 {
> 3092 delete_trivially_dead_insns (insns,
> max_reg_num ());
> 3093 reg_alloc ();
> 3094
> 3095 timevar_pop (TV_LOCAL_ALLOC);
> 3096 if (dump_file[DFI_lreg].enabled)
> 3097 {
> 3098 timevar_push (TV_DUMP);
> 3099
> 3100 close_dump_file (DFI_lreg, NULL,
> NULL);
> 3101 timevar_pop (TV_DUMP);
> 3102 }
> 3103
> 3104 /* XXX clean up the whole mess to bring
> live info in shape
> again. */
> 3105 timevar_push (TV_GLOBAL_ALLOC);
> 3106 open_dump_file (DFI_greg, decl);
> 3107
> 3108 build_insn_chain (insns);
> 3109 failure = reload (insns, 0);
>
> would not that imply spill code in a seperate pass
> after reg_alloc or I am missing something.
Reload used for following things:
1. Eliminate registers (fp elimination, argp elimination, ...);
2. Add registers for (match_scratch ...);
3. Fixing wrong insns, Insns with constrains '%0...9';
4. Fixing wrong addresses.
5. Old (original) regclass can choose wrong class - class which will not
satisfy constraints from all insns in which register used;
6. May be I forgot something.
> As I understand handling spill should be part
> of reg_alloc from ur previous reply.
Handling spill is a part of reg_alloc.
Denis.