From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13843 invoked by alias); 8 Nov 2009 09:56:44 -0000 Received: (qmail 13830 invoked by uid 22791); 8 Nov 2009 09:56:43 -0000 X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS,SUBJECT_FUZZY_VPILL X-Spam-Check-By: sourceware.org Received: from mail-pz0-f181.google.com (HELO mail-pz0-f181.google.com) (209.85.222.181) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Nov 2009 09:56:40 +0000 Received: by pzk11 with SMTP id 11so1473016pzk.14 for ; Sun, 08 Nov 2009 01:56:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.172.20 with SMTP id u20mr345651rve.23.1257674198391; Sun, 08 Nov 2009 01:56:38 -0800 (PST) In-Reply-To: References: Date: Sun, 08 Nov 2009 09:57:00 -0000 Message-ID: <84fc9c000911080156iff6d687o26db10af3e9fba5d@mail.gmail.com> Subject: Re: [vta, graphite?] propagate degenerate phi nodes into debug stmts From: Richard Guenther To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00423.txt.bz2 On Sun, Nov 8, 2009 at 8:46 AM, Alexandre Oliva wrote: > This patch arranges for PHI nodes to be propagated into debug stmts upon > release, if possible. =A0This improves debug info quality a bit, for > without this change we'd end up resetting the debug stmt. > > It's not clear to me how this helped (if at all) graphite failures with > VTA, but it helped retain debug annotations that enabled me to validate > the fix for PR 41926 in a C testcase. =A0But that's something for another > patch. > > Bootstrapped on x86_64-linux-gnu; regstrapping on that and > ia64-linux-gnu. =A0Ok to install? @@ -383,13 +402,22 @@ insert_debug_temp_for_var_def (gimple_st dead SSA NAMEs. SSA verification shall catch any errors. */ if ((!gsi && !gimple_bb (def_stmt)) - || !walk_gimple_op (def_stmt, find_released_ssa_name, - &wi)) + || walk_gimple_op (def_stmt, find_released_ssa_name, &wi)) no_value =3D true; please install this as a separate revision - it seems to be an unrelated bu= gfix. For the rest it would be better to re-organize the code as - if (is_gimple_assign (def_stmt)) { ... keep unchanged ... } else if (gimple_code (def_stmt) =3D=3D PHI_NODE) { value =3D degenerate_phi_result (def_stmt); if (value && walk_tree (&value, find_released_ssa_name, NULL, NULL)) value =3D NULL_TREE; } that looks simpler and it avoids walking PHI args uselessly. @@ -479,6 +508,13 @@ insert_debug_temps_for_defs (gimple_stmt stmt =3D gsi_stmt (*gsi); + if (gimple_code (stmt) =3D=3D GIMPLE_PHI) + { + tree var =3D gimple_phi_result (stmt); + insert_debug_temp_for_var_def (gsi, var); + return; + } + This looks odd. SSA DEF operand iteration should walk the PHI defs as well, so the change should not be necessary. Ok with that changes. Thanks, Richard. > > > -- > Alexandre Oliva, freedom fighter =A0 =A0http://FSFLA.org/~lxoliva/ > You must be the change you wish to see in the world. -- Gandhi > Be Free! -- http://FSFLA.org/ =A0 FSF Latin America board member > Free Software Evangelist =A0 =A0 =A0Red Hat Brazil Compiler Engineer > >