public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Arnaldo <arnaldo.cruz@upr.edu>
Cc: Michael Matz <matz@suse.de>, gcc@gcc.gnu.org
Subject: Re: Iterating over RTL in Graphite
Date: Mon, 05 Mar 2012 14:58:00 -0000	[thread overview]
Message-ID: <CAFiYyc0RNJDMJRTapvJMWLCab+-i0jUt+g7UCa8y4uCQBZj+DQ@mail.gmail.com> (raw)
In-Reply-To: <CAB=90XCsxZypNmDT_PAo9JOLwM09yoatcXf14GLG+oc_O+qfmw@mail.gmail.com>

On Mon, Mar 5, 2012 at 3:52 PM, 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.

Graphite (polyhedral form) is even more high-level, how do you expect
RTX costs to be meaningful there at all?

> 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.

I don't even see how you could compute a reliable mapping of Graphite
(or GIMPLE) to the RTL you generate that way.

Richard.

> -Arnaldo

  reply	other threads:[~2012-03-05 14:58 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 [this message]
2012-03-05 15:24             ` David Edelsohn
2012-03-05 15:31               ` Arnaldo
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=CAFiYyc0RNJDMJRTapvJMWLCab+-i0jUt+g7UCa8y4uCQBZj+DQ@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=arnaldo.cruz@upr.edu \
    --cc=gcc@gcc.gnu.org \
    --cc=matz@suse.de \
    /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).