scheduler fix for small register classes

Alexandre Oliva aoliva@redhat.com
Mon Jun 19 21:46:00 GMT 2006


Hi,

While working with Glauber on TLS improvements for ARM, we've come
across a problem in the scheduler.  Even though the scheduler is
careful enough to not extend the life of CLASS_LIKELY_SPILLED_P
classes before reload, to avoid problems such as moving the
instruction that sets the return value before other instructions that
might need that hardware register, it does nothing to avoid extending
the life of hardware registers holding incoming arguments.  Even
though combine avoids substituting such hardware registers, schedule
might still move the copies from the hardware registers to pseudos,
emitted before the function begin note, past instructions that might
require such hardware registers, and then reload loses.

This patch fixes this problem, by arranging for the function begin
note to be a scheduler move barrier before reload, thus avoiding the
harmful rearrangement.

Bootstrapped and tested on amd64-linux-gnu native and cross to
arm-linux-gnu, with a patch that modifies SMALL_REGISTER_CLASSES in
arm.h so as to be defined to 1, and introduces a register class
containing only r0, as well as a number of TLS-related instructions
that use the new class.

Ok to install?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-sched-small-classes.patch
Type: text/x-patch
Size: 1364 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060619/56875e12/attachment.bin>
-------------- next part --------------


-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Secretary for FSF Latin America        http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


More information about the Gcc-patches mailing list