This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Iterating over RTL in Graphite
- From: Arnaldo <arnaldo dot cruz at upr dot edu>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 5 Mar 2012 10:52:25 -0400
- Subject: Re: Iterating over RTL in Graphite
- Authentication-results: mr.google.com; spf=pass (google.com: domain of arnaldo.cruz@upr.edu designates 10.50.217.137 as permitted sender) smtp.mail=arnaldo.cruz@upr.edu
- References: <CAB=90XDwy+H3q4BfMVOeVb7BRHHD=_Ju4iV-k6E7hsqaNWzxZg@mail.gmail.com> <1329507251.15787.25.camel@surprise> <4F3F09A5.5050301@grosser.es> <CAB=90XDPXDizzODHM5Kgt0EGSb8gaBR_MMm8EBBm=H60gNTVCQ@mail.gmail.com> <CAB=90XCrNC7SYLaGkPH0HjgM9pi2TLOfSRR6xRSY7H7-ZQJCKw@mail.gmail.com> <Pine.LNX.4.64.1203051458080.25409@wotan.suse.de>
On Mon, Mar 5, 2012 at 10:00 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Mon, 5 Mar 2012, Arnaldo wrote:
>
>> I couldn't get cfgexpand.c:basic_block expand_gimple_basic_block
>> (basic_block bb) to work by calling it directly because there is some
>> preprocessing in gimple_expand_cfg() that has to be done first. ?But
>> calling gimple_expand_cfg() modifies the CFG and asserts will fail later
>> on during compilation.
>>
>> I think the only way to solve this would be to somehow duplicate the
>> current cfun structure when entering the part of Graphite I'm extending,
>> then calling push_cfun(), gimple_expand_cfg(), extracting the BBs with
>> the RTL and calling pop_cfun() before continuing.
>
> Really, you're barking up the wrong tree. ?graphite doesn't work on the
> RTL IL, it'll work only on gimple. ?expanding is what we call the process
> of transforming gimple to RTL, and that process destroys gimple. ?Hence
> you can't do that when still at the gimple side of things as there are
> still passes to run that run in gimple.
>
> Whatever you want to do with graphite, you have to do it at the gimple
> level.
>
>
> Ciao,
> Michael.
Richard, Michael,
I have to find a way to generate the RTL because I have profiled an
instruction set and I need access to these costs during my extension
to the Graphite pass. I planed to add these costs as attributes to
the RTX patterns in the machine description file and read the back
from Graphite. Gimple seems to be too high-level to associate its
statements to machine costs.
I know this is not the way GCC was designed but the optimization I'm
working on needs access to the profile. Maybe there's a better way of
doing this? What I'm attempting to do now is to duplicate the current
cfun so that I can expand and read the RTL attributes and then discard
this cfun before continuing with the compilation.
-Arnaldo