This is the mail archive of the 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: What to do with new-ra for GCC 4.0

>    I agree with all you say above, except that the things the existing
>    allocator does shouldn't be replicated, but moved to an earlier point
>    in the compilation process.  Specifically, "instruction selection",
>    or in GCC terms alternative selection, should happen before regalloc
>    as much as possible,
>But you can't.  It's fairly common (especially on DSP-like machines)
>to have a pseudo used in multiple instructions, each of which require
>a different register class for that operand.  If you define "register
>allocation" as producing a single register to be allocated to a pseudo
>(and I recognize that we may want to do splitting earlier), then you can't
>do instruction selection too early.  Consider the 68k, which has two add
>instructions, one which operates only on data registers and one which
>operates only on address register.  You can't possibly decide which one to
>use until you've allocate all the pseudos, though you certainly can (and
>we do) use knowlege of those possibilities in deciding how to allocate the

But you can try to first do register class assignment, and then do register
allocation within each class. Admittedly, this may result in suboptimal
decisions compared to doing them together.
See for instance
(this was for a DSP too).


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