Patchwork Stream TYPE_NONALIASED_COMPONENT in LTO mode

login
register
mail settings
Submitter Eric Botcazou
Date Sept. 24, 2012, 10:05 a.m.
Message ID <3036368.zAi4UHg0cd@polaris>
Download mbox | patch
Permalink /patch/186357/
State New
Headers show

Comments

Eric Botcazou - Sept. 24, 2012, 10:05 a.m.
Hi,

although the type merging machinery deals with TYPE_NONALIASED_COMPONENT, the 
flag is actually not streamed, which can result in strange performance drops 
for Ada applications in LTO mode.  The attached patch plugs this hole.

Tested on x86_64-suse-linux and LTO-bootstrapped.  I also checked that the 4.7 
compiler can still compile a big Ada application in LTO mode.  Can I put this 
both on mainline and 4.7 branch?  This only affects Ada.


2012-09-24  Eric Botcazou  <ebotcazou@adacore.com>

	* tree-streamer-in.c (unpack_ts_type_common_value_fields): Stream in
	TYPE_NONALIASED_COMPONENT flag.
	* tree-streamer-out.c (pack_ts_type_common_value_fields): Stream out
	TYPE_NONALIASED_COMPONENT flag.
Richard Guenther - Sept. 24, 2012, 10:08 a.m.
On Mon, Sep 24, 2012 at 12:05 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> although the type merging machinery deals with TYPE_NONALIASED_COMPONENT, the
> flag is actually not streamed, which can result in strange performance drops
> for Ada applications in LTO mode.  The attached patch plugs this hole.
>
> Tested on x86_64-suse-linux and LTO-bootstrapped.  I also checked that the 4.7
> compiler can still compile a big Ada application in LTO mode.  Can I put this
> both on mainline and 4.7 branch.  This only affects Ada.

Yes, sure.

Thanks,
Richard.

>
> 2012-09-24  Eric Botcazou  <ebotcazou@adacore.com>
>
>         * tree-streamer-in.c (unpack_ts_type_common_value_fields): Stream in
>         TYPE_NONALIASED_COMPONENT flag.
>         * tree-streamer-out.c (pack_ts_type_common_value_fields): Stream out
>         TYPE_NONALIASED_COMPONENT flag.
>
>
> --
> Eric Botcazou

Patch

Index: tree-streamer-out.c
===================================================================
--- tree-streamer-out.c	(revision 191365)
+++ tree-streamer-out.c	(working copy)
@@ -279,6 +279,8 @@  pack_ts_type_common_value_fields (struct
   bp_pack_value (bp, TYPE_NEEDS_CONSTRUCTING (expr), 1);
   if (RECORD_OR_UNION_TYPE_P (expr))
     bp_pack_value (bp, TYPE_TRANSPARENT_AGGR (expr), 1);
+  else if (TREE_CODE (expr) == ARRAY_TYPE)
+    bp_pack_value (bp, TYPE_NONALIASED_COMPONENT (expr), 1);
   bp_pack_value (bp, TYPE_PACKED (expr), 1);
   bp_pack_value (bp, TYPE_RESTRICT (expr), 1);
   bp_pack_value (bp, TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr), 2);
Index: tree-streamer-in.c
===================================================================
--- tree-streamer-in.c	(revision 191365)
+++ tree-streamer-in.c	(working copy)
@@ -335,6 +335,8 @@  unpack_ts_type_common_value_fields (stru
   TYPE_NEEDS_CONSTRUCTING (expr) = (unsigned) bp_unpack_value (bp, 1);
   if (RECORD_OR_UNION_TYPE_P (expr))
     TYPE_TRANSPARENT_AGGR (expr) = (unsigned) bp_unpack_value (bp, 1);
+  else if (TREE_CODE (expr) == ARRAY_TYPE)
+    TYPE_NONALIASED_COMPONENT (expr) = (unsigned) bp_unpack_value (bp, 1);
   TYPE_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);
   TYPE_RESTRICT (expr) = (unsigned) bp_unpack_value (bp, 1);
   TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr)