public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Arnaldo <arnaldo.cruz@upr.edu>
To: David Edelsohn <dje.gcc@gmail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Iterating over RTL in Graphite
Date: Mon, 05 Mar 2012 15:31:00 -0000	[thread overview]
Message-ID: <CAB=90XAyV5=D3rH1vwNUrfh=HWKZ9ZohoektLZPfwuNhunLHMA@mail.gmail.com> (raw)
In-Reply-To: <CAGWvnym=t4EYHVqfb-mig2C6yMA7-Oaa8ROxi0W5YuWczgs3kQ@mail.gmail.com>

On Mon, Mar 5, 2012 at 11:17 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
> On Mon, Mar 5, 2012 at 9:52 AM, Arnaldo <arnaldo.cruz@upr.edu> wrote:
>> 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.
>
> You can look in the SSA loop optimizations (tree-ssa-loop-ivopts.c?)
> for some code that basically compiles little snippets from GIMPLE to
> RTL, computes RTX costs, and then tries to map those back to GIMPLE.
> It's very ugly and limited accuracy.
>
> - David

David thanks that seems to be what I need, I'll look into that first.

Richard,
For each BB in an SCoP I could add the costs of its RTX to compute a
cost for the BB and then transform the polyhedral matrices to try to
estimate the program cost using different nested loop configurations.

-Arnaldo

  reply	other threads:[~2012-03-05 15:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-17  9:53 Arnaldo
2012-02-17 22:52 ` David Malcolm
2012-02-18 10:37   ` Tobias Grosser
2012-02-18 22:54     ` Arnaldo
2012-03-05 13:51       ` Arnaldo
2012-03-05 13:58         ` Richard Guenther
2012-03-05 14:00         ` Michael Matz
2012-03-05 14:52           ` Arnaldo
2012-03-05 14:58             ` Richard Guenther
2012-03-05 15:24             ` David Edelsohn
2012-03-05 15:31               ` Arnaldo [this message]
2012-03-05 15:37                 ` Richard Guenther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAB=90XAyV5=D3rH1vwNUrfh=HWKZ9ZohoektLZPfwuNhunLHMA@mail.gmail.com' \
    --to=arnaldo.cruz@upr.edu \
    --cc=dje.gcc@gmail.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).