|Dlxcc, and register allocation email@example.com (William C. Kreahling) (1998-06-18)|
|Re: Dlxcc, and register allocation firstname.lastname@example.org (Michael Meissner) (1998-06-19)|
|From:||Michael Meissner <email@example.com>|
|Date:||19 Jun 1998 10:31:40 -0400|
"William C. Kreahling" <firstname.lastname@example.org> writes:
> I was wondering if anyone had any information about register
> allocation in dlxcc. Dlxcc is a gcc cross compiler that takes C code and
> converts it to code for a dlx simulator. Dlxcc also does register
> allocation on that code. For my purposes I would like it to generate the
> code without doing any register allocation. S I am having to search
> though the code trying to find and disable the register allocation (if
> possible). If anyone has any ideas, or could even point me in the right
> direction I would greatly appreciate it. Since dlxcc is a gcc cross
> compiler, any info on how gcc itself handles regsiter would also be a
In the GCC scheme of things, when optimizing, the first pass of
register allocation is in local-alloc.c (with a prepass in
regclass.c), the second pass is global.c, and the third pass is
reload1.c (with subroutines in reload.c). The file toplev.c controls
calling the various passes (note, the third pass is called from within
the second pass). If you are not optimizing, then the compiler does
two passes, first stupid.c to try and honor register declarations but
nothing else, and then calling reload to deal with everything else.
The local-alloc pass involves allocating registers that are only used
in a basic block, and not used elsewhere.
The global pass involves allocating the registers that are used in
more than one basic blocks.
The reload pass involves allocating spill registers for those
registers that did not get a hard register, and making sure each
instruction has the operands in the proper registers. In general, it
is a harder pass to understand than the others.
I suspect it might be easier to just bump up the number of physical
registers to a much higher number (say 1000). Note, if you change the
# of registers, you probably need to rebuild the compiler from
scratch, since the GCC Makefile does not list dependencies of the
Michael Meissner, Cygnus Solutions (Massachusetts office)
4th floor, 955 Massachusetts Avenue, Cambridge, MA 02139, USA
email@example.com, 617-354-5416 (office), 617-354-7161 (fax)
Return to the
Search the comp.compilers archives again.