From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2553 invoked by alias); 5 Mar 2012 14:00:27 -0000 Received: (qmail 2541 invoked by uid 22791); 5 Mar 2012 14:00:26 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Mar 2012 14:00:10 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 9527C8FA98; Mon, 5 Mar 2012 15:00:09 +0100 (CET) Date: Mon, 05 Mar 2012 14:00:00 -0000 From: Michael Matz To: Arnaldo Cc: Tobias Grosser , David Malcolm , gcc@gcc.gnu.org Subject: Re: Iterating over RTL in Graphite In-Reply-To: Message-ID: References: <1329507251.15787.25.camel@surprise> <4F3F09A5.5050301@grosser.es> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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/msg00053.txt.bz2 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.