From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17158 invoked by alias); 5 Mar 2012 14:52:52 -0000 Received: (qmail 17143 invoked by uid 22791); 5 Mar 2012 14:52:51 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Mar 2012 14:52:26 +0000 Received: by iaag37 with SMTP id g37so5764187iaa.20 for ; Mon, 05 Mar 2012 06:52:25 -0800 (PST) Received-SPF: pass (google.com: domain of arnaldo.cruz@upr.edu designates 10.50.217.137 as permitted sender) client-ip=10.50.217.137; Authentication-Results: mr.google.com; spf=pass (google.com: domain of arnaldo.cruz@upr.edu designates 10.50.217.137 as permitted sender) smtp.mail=arnaldo.cruz@upr.edu Received: from mr.google.com ([10.50.217.137]) by 10.50.217.137 with SMTP id oy9mr7046338igc.31.1330959145980 (num_hops = 1); Mon, 05 Mar 2012 06:52:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.217.137 with SMTP id oy9mr5831004igc.31.1330959145921; Mon, 05 Mar 2012 06:52:25 -0800 (PST) Received: by 10.231.64.207 with HTTP; Mon, 5 Mar 2012 06:52:25 -0800 (PST) In-Reply-To: References: <1329507251.15787.25.camel@surprise> <4F3F09A5.5050301@grosser.es> Date: Mon, 05 Mar 2012 14:52:00 -0000 Message-ID: Subject: Re: Iterating over RTL in Graphite From: Arnaldo To: Michael Matz Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQnauNJ1jKCoWjuJ7pZ57DY9mrkCRggn0oIj3iWFtjD43hC4eklXPctipRM2UiwoEmVtgvX3 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-03/txt/msg00054.txt.bz2 On Mon, Mar 5, 2012 at 10:00 AM, Michael Matz 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. =A0But >> 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. =A0graphite doesn't work on the > RTL IL, it'll work only on gimple. =A0expanding is what we call the proce= ss > of transforming gimple to RTL, and that process destroys gimple. =A0Hence > 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. -Arnaldo