public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Doug Kwan (關振德)" <dougkwan@google.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>,
	        "Diego Novillo" <dnovillo@google.com>
Subject: [PATCH][LTO] Clean up special casing for case GIMPLE_CHANGE_DYNAMIC_TYPE
Date: Mon, 29 Sep 2008 22:10:00 -0000	[thread overview]
Message-ID: <498552560809291419s2060233eke8f36584b31cf91d@mail.gmail.com> (raw)

Hi Diego,

   After your last check-in, the streamer handles types as expression
operands.  I think these are no longer required.  Tested on
i686-unknown-linux-gnu.

-Doug

008-09-29  Doug Kwan  <dougkwan@google.com>

        * lto-function-out.c (output_gimple_stmt): Remove special
        case code for GIMPLE_CHANGE_DYNAMIC_TYPE.  Use the general
        code to handle this gimple code.
        * lto-function-in.c (input_gimple_stmt): Ditto.

Index: gcc/gcc/lto-function-out.c
===================================================================
--- gcc/gcc/lto-function-out.c	(revision 140763)
+++ gcc/gcc/lto-function-out.c	(working copy)
@@ -1858,6 +1858,7 @@ output_gimple_stmt (struct output_block
     case GIMPLE_GOTO:
     case GIMPLE_PREDICT:
     case GIMPLE_RESX:
+    case GIMPLE_CHANGE_DYNAMIC_TYPE:
       for (i = 0; i < gimple_num_ops (stmt); i++)
 	{
 	  tree op = gimple_op (stmt, i);
@@ -1868,13 +1869,6 @@ output_gimple_stmt (struct output_block
 	}
       break;

-    case GIMPLE_CHANGE_DYNAMIC_TYPE:
-      /* The first operand of GIMPLE_CHANGE_DYNAMIC_TYPE is a type.
-	 So have to handle it specially.  */
-      output_type_ref (ob, gimple_cdt_new_type (stmt));
-      output_expr_operand (ob, gimple_cdt_location (stmt));
-      break;
-
     default:
       gcc_unreachable ();
     }
Index: gcc/gcc/lto-function-in.c
===================================================================
--- gcc/gcc/lto-function-in.c	(revision 140763)
+++ gcc/gcc/lto-function-in.c	(working copy)
@@ -2033,35 +2033,16 @@ input_gimple_stmt (struct lto_input_bloc
       stmt->gimple_asm.string = TREE_STRING_POINTER (str);
     }

-  /* GIMPLE_CHANGE_DYNAMIC_TYPE is special.  The first operand is a
-     type.  So handle it specially.  We assume both operands are
-     never NULL. */
-  if (code == GIMPLE_CHANGE_DYNAMIC_TYPE)
+  for (i = 0; i < num_ops; i++)
     {
-      tree new_type, location;
-      enum LTO_tags tag;
-
-      new_type = input_type_ref (data_in, ib);
-      gimple_cdt_set_new_type (stmt, new_type);
-
-      tag = input_record_start (ib);
-      gcc_assert (tag);
-      location = input_expr_operand (ib, data_in, fn, tag);
-      gimple_cdt_set_location (stmt, location);
-    }
-  else
-    {
-      for (i = 0; i < num_ops; i++)
+      enum LTO_tags tag = input_record_start (ib);
+      if (tag)
 	{
-	  enum LTO_tags tag = input_record_start (ib);
-	  if (tag)
-	    {
-	      /* FIXME lto.  We shouldn't be writing NULL operands.  Use
-		 alternate tags to identify tuple variants (e.g.,
-		 GIMPLE_CALLs without a return value).  */
-	      tree op = input_expr_operand (ib, data_in, fn, tag);
-	      gimple_set_op (stmt, i, op);
-	    }
+	  /* FIXME lto.  We shouldn't be writing NULL operands.  Use
+	     alternate tags to identify tuple variants (e.g.,
+	     GIMPLE_CALLs without a return value).  */
+	  tree op = input_expr_operand (ib, data_in, fn, tag);
+	  gimple_set_op (stmt, i, op);
 	}
     }

             reply	other threads:[~2008-09-29 21:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-29 22:10 Doug Kwan (關振德) [this message]
2008-09-29 22:33 ` Diego Novillo
2008-09-29 23:49   ` Doug Kwan (關振德)

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=498552560809291419s2060233eke8f36584b31cf91d@mail.gmail.com \
    --to=dougkwan@google.com \
    --cc=dnovillo@google.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).