From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10291 invoked by alias); 20 Oct 2004 20:38:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 10268 invoked from network); 20 Oct 2004 20:38:37 -0000 Received: from unknown (HELO dberlin.org) (68.164.203.246) by sourceware.org with SMTP; 20 Oct 2004 20:38:37 -0000 Received: from [129.34.20.23] (HELO [9.2.217.169]) by dberlin.org (CommuniGate Pro SMTP 4.2.1) with ESMTP id 7401837; Wed, 20 Oct 2004 16:38:37 -0400 In-Reply-To: <1098304350.22552.47.camel@localhost.localdomain> References: <1098293613.22552.36.camel@localhost.localdomain> <1098294982.22552.38.camel@localhost.localdomain> <1098304350.22552.47.camel@localhost.localdomain> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <04DB6F48-22D8-11D9-B310-000D93B1B044@dberlin.org> Content-Transfer-Encoding: 7bit Cc: "gcc-patches@gcc.gnu.org" , Andrew Macleod From: Daniel Berlin Subject: Re: [PATCH]: Implement must-def kill operand Date: Wed, 20 Oct 2004 20:49:00 -0000 To: Diego Novillo X-SW-Source: 2004-10/txt/msg01770.txt.bz2 On Oct 20, 2004, at 4:32 PM, Diego Novillo wrote: > On Wed, 2004-10-20 at 14:20, Daniel Berlin wrote: > >> 1. Do a quick propagation pass in DCE to make sure def-def phis that >> are used in necessary statements don't die. (at that point, plain >> def-def renaming will work) >> 2. Mark the must-def operand as necessary if it's a phi, and the only >> immediate use of the phi is in the must-def operand (I'm assuming it >> could appear in a may-def or vuse somewhere else, in which case it's >> necessary). >> 3. Use the full renamer, which will simply put the phi back after DCE >> removes it. >> > 4. If the RHS of a V_MUST_DEF is a PHI node, mark it necessary? That's #1, actually. Before remove_stmts, i meant you do this: FOR EACH MUSTDEF: If RHS is a phi node and marked unnecessary: add phi node to worklist. Until worklist is empty: pop phi off worklist. Mark as necessary. For each phi node argument that is a phi node marked unnecessary, add to worklist. This also catches the mutually recursive phis like: a_1 = phi > a_2 = phi a_4 = must_def You actually have to worklist it because those phi nodes may use phi nodes, and you have to mark those phi nodes as necessary as well. :) > > > Diego. >