From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17239 invoked by alias); 18 Feb 2012 02:15:24 -0000 Received: (qmail 17225 invoked by uid 22791); 18 Feb 2012 02:15:22 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from out5-smtp.messagingengine.com (HELO out5-smtp.messagingengine.com) (66.111.4.29) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 18 Feb 2012 02:15:08 +0000 Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 9333E211C1 for ; Fri, 17 Feb 2012 21:15:07 -0500 (EST) Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute4.internal (MEProxy); Fri, 17 Feb 2012 21:15:07 -0500 Received: from [192.168.1.10] (dan75-6-82-239-15-125.fbx.proxad.net [82.239.15.125]) by mail.messagingengine.com (Postfix) with ESMTPSA id E4F7E8E00B8; Fri, 17 Feb 2012 21:15:06 -0500 (EST) Message-ID: <4F3F09A5.5050301@grosser.es> Date: Sat, 18 Feb 2012 10:37:00 -0000 From: Tobias Grosser User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:8.0) Gecko/20111103 Thunderbird/8.0 MIME-Version: 1.0 To: David Malcolm CC: Arnaldo , gcc@gcc.gnu.org Subject: Re: Iterating over RTL in Graphite References: <1329507251.15787.25.camel@surprise> In-Reply-To: <1329507251.15787.25.camel@surprise> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2012-02/txt/msg00353.txt.bz2 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