public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Arnaldo <arnaldo.cruz@upr.edu>
To: Tobias Grosser <tobias@grosser.es>
Cc: David Malcolm <dmalcolm@redhat.com>, gcc@gcc.gnu.org
Subject: Re: Iterating over RTL in Graphite
Date: Sat, 18 Feb 2012 22:54:00 -0000	[thread overview]
Message-ID: <CAB=90XDPXDizzODHM5Kgt0EGSb8gaBR_MMm8EBBm=H60gNTVCQ@mail.gmail.com> (raw)
In-Reply-To: <4F3F09A5.5050301@grosser.es>

On Fri, Feb 17, 2012 at 10:15 PM, Tobias Grosser <tobias@grosser.es> wrote:
> On 02/17/2012 08:34 PM, David Malcolm wrote:
>>
>> On Thu, 2012-02-16 at 19:17 -0400, Arnaldo wrote:
>>>
>>> Hello everyone,
>>>
>>> I'm working on an extension to the Graphite pass of GCC 4.4.0.  My
>>> intention is to associate costs to RTL instructions by adding them as
>>> RTX attributes to a machine description file, and to read them back
>>> during the Graphite pass by iterating through each basic block.
>>>
>>> Is the RTL available during this optimization pass? I'm not sure this
>>> is the case as I get a segfault when trying to iterate over the RTL
>>> with the code below ("internal compiler error: Segmentation fault"). I
>>> don't need the fully resolved RTL, just to be able to read the
>>> attribute given an RTL instruction.
>>>
>>> I've tried debugging the compiler with gdb but it can't find the
>>> debugging symbols even though they're there.  I'll keep trying to get
>>> gdb to work but any leads on reading these attributes from within
>>> Graphite is greatly appreciated.
>>
>> I don't know about GCC 4.4, but a while back I wrote a script using my
>> GCC Python plugin to draw a "subway map" of GCC 4.6's passes:
>> http://gcc.gnu.org/ml/gcc/2011-07/msg00157.html
>> which you can see here:
>> http://gcc-python-plugin.readthedocs.org/en/latest/tables-of-passes.html
>>
>> If I reading things correctly, the graphite passes happen whilst the
>> code is still in gimple form: the blocks are converted to RTL form in
>> the "expand" pass, which happens about 20 or so passes later.
>>
>> Caveat: I'm not familiar with the insides of the graphite, and am
>> relatively new to gcc's insides, so I could be wrong; also the script
>> relies on the pass flags, and they're not necessarily correct either...
>
>
> Yes, graphite works on GIMPLE. I believe I have never seen RTL when working
> on graphite, so I doubt it is easily available. (Maybe it is, but it is
> definitely not used within graphite).
>
> Cheers
> Tobi
>

Thanks David and Tobias, that helped.

I started looking into the expand pass (cfgexpand.c), there's an
interesting function there:
static basic_block expand_gimple_basic_block (basic_block bb)

When I get a change I'll make it 'public' and see if I can call it
from graphite.c

-Arnaldo

  reply	other threads:[~2012-02-18 22:46 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 [this message]
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
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=90XDPXDizzODHM5Kgt0EGSb8gaBR_MMm8EBBm=H60gNTVCQ@mail.gmail.com' \
    --to=arnaldo.cruz@upr.edu \
    --cc=dmalcolm@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=tobias@grosser.es \
    /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).