Regimplification enhancements 1/3

Bernd Schmidt bernds@codesourcery.com
Mon Jun 16 17:49:00 GMT 2014


On 06/16/2014 07:26 PM, Mike Stump wrote:
> On Jun 16, 2014, at 3:56 AM, Bernd Schmidt <bernds@codesourcery.com>
> wrote:
>> For the ptx port, I've needed to write a new pass which ensures all
>> objects go into address spaces as required by the machine.
>
> I have such a machine and IÂ’ve always approached the problem from the
> front end side.  I ensure the right space up front, and if someone
> doesnÂ’t get the right space, I add code to let the port choose the
> space for that object (literal constants I wanna play around with
> some for example).  On my port there is no changing spaces once one
> is selected.

There are two reasons why I can't do this in the frontends - one, Joseph 
has already rejected a C frontend patch, and two, this needs to work 
with OpenACC offloading - i.e. code is initially compiled by an x86 host 
compiler, then a ptx lto1 reads it in and needs to make it valid for 
that target.

> IÂ’m curious if your port needs to change a space (and why, IÂ’m
> wondering if I can improve my port by changing spaces)?

No, address spaces are fixed for globals, locals, and rodata. But in the 
early stages of the compiler, for the above reasons we need to pretend 
that there aren't any address spaces involved, and only the 
lower-addr-spaces pass moves everything to the right place.


Bernd



More information about the Gcc-patches mailing list