From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20279 invoked by alias); 17 Feb 2012 19:35:12 -0000 Received: (qmail 20104 invoked by uid 22791); 17 Feb 2012 19:35:11 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Feb 2012 19:34:51 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1HJYoQR027060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Feb 2012 14:34:50 -0500 Received: from [10.16.189.64] (dhcp-189-64.bos.redhat.com [10.16.189.64]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1HJYnwA012762; Fri, 17 Feb 2012 14:34:50 -0500 Subject: Re: Iterating over RTL in Graphite From: David Malcolm To: Arnaldo Cc: gcc@gcc.gnu.org Date: Fri, 17 Feb 2012 22:52:00 -0000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Message-ID: <1329507251.15787.25.camel@surprise> Mime-Version: 1.0 X-IsSubscribed: yes 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/msg00351.txt.bz2 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... Hope this is helpful Dave