public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Alexandre Oliva <aoliva@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [vta, graphite?] propagate degenerate phi nodes into debug stmts
Date: Sun, 08 Nov 2009 09:57:00 -0000	[thread overview]
Message-ID: <84fc9c000911080156iff6d687o26db10af3e9fba5d@mail.gmail.com> (raw)
In-Reply-To: <orfx8ph31l.fsf@livre.localdomain>

On Sun, Nov 8, 2009 at 8:46 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
> This patch arranges for PHI nodes to be propagated into debug stmts upon
> release, if possible.  This 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.  But that's something for another
> patch.
>
> Bootstrapped on x86_64-linux-gnu; regstrapping on that and
> ia64-linux-gnu.  Ok 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 = true;

please install this as a separate revision - it seems to be an unrelated bugfix.

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) == PHI_NODE)
     {
        value = degenerate_phi_result (def_stmt);
        if (value
            && walk_tree (&value, find_released_ssa_name, NULL, NULL))
          value = NULL_TREE;
     }

that looks simpler and it avoids walking PHI args uselessly.

@@ -479,6 +508,13 @@ insert_debug_temps_for_defs (gimple_stmt

   stmt = gsi_stmt (*gsi);

+  if (gimple_code (stmt) == GIMPLE_PHI)
+    {
+      tree var = 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    http://FSFLA.org/~lxoliva/
> You must be the change you wish to see in the world. -- Gandhi
> Be Free! -- http://FSFLA.org/   FSF Latin America board member
> Free Software Evangelist      Red Hat Brazil Compiler Engineer
>
>

  reply	other threads:[~2009-11-08  9:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-08  8:07 Alexandre Oliva
2009-11-08  9:57 ` Richard Guenther [this message]
2009-11-16 20:35   ` Alexandre Oliva
2009-11-16 20:48   ` Alexandre Oliva
2009-11-17 15:47     ` Richard Guenther
2009-11-19  4:18       ` Alexandre Oliva
2009-11-19 10:56         ` Richard Guenther
2009-11-20  9:37           ` Alexandre Oliva
2009-11-20 10:47             ` Richard Guenther
2009-11-21  5:22               ` Alexandre Oliva
2011-06-03 14:38           ` Alexandre Oliva
2011-06-06  9:37             ` Richard Guenther
2011-06-07 10:38               ` Alexandre Oliva
2011-06-07 12:04                 ` Richard Guenther
2009-11-19  4:28       ` Alexandre Oliva
2009-11-19 10:59         ` Richard Guenther
2009-11-20  9:26           ` Alexandre Oliva
2009-12-05 16:04             ` H.J. Lu
2009-12-23  8:58               ` H.J. Lu
2010-01-29 17:02                 ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84fc9c000911080156iff6d687o26db10af3e9fba5d@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=aoliva@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).