From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3138 invoked by alias); 24 Jul 2003 19:57:10 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 3128 invoked from network); 24 Jul 2003 19:57:07 -0000 Received: from unknown (HELO mail.kloo.net) (63.192.214.25) by sources.redhat.com with SMTP; 24 Jul 2003 19:57:07 -0000 Received: by mail.kloo.net (Postfix, from userid 504) id 2E04E3B0308; Thu, 24 Jul 2003 12:45:59 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.kloo.net (Postfix) with ESMTP id 2C5B73B4384; Thu, 24 Jul 2003 12:45:59 -0700 (PDT) Date: Thu, 24 Jul 2003 21:12:00 -0000 From: To: Jan Hoogerbrugge Cc: gcc@gcc.gnu.org Subject: Re: Transformations to increase parallelism (peepholes?) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2003-07/txt/msg01739.txt.bz2 On Wed, 23 Jul 2003, Jan Hoogerbrugge wrote: > Would it be possible to do (some of) these transformations by means of > peepholes in the .md file? If so, could somebody tell me how a peephole > should look like for > > reg1 = reg2 + const1 > reg3 = reg1 + const2 > > to > > reg1 = reg2 + const1 > reg3 = reg2 + (const1 + const2) > > where const1 + const2 has to be within certain bounds. It tried to write a > peephole for this but without success. Who helps? > > Cheers, > Jan You can't treat GCC like a black box and expect this to work. You need to use GDB and debug the peephole optimizer and figure out why your pattern isn't matching. You can use the "call" command and use it with debug_rtx() to debug the peephole optimizer. You probably don't want to do this with the peephole optimizer, since it runs after both instruction scheduling passes. You probably want to use peephole2 instead. Toshi