Author: pluto                        Date: Mon Jun 16 11:17:41 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:


---- Files affected:
SOURCES:
   gcc-pr36519.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/gcc-pr36519.patch
diff -u /dev/null SOURCES/gcc-pr36519.patch:1.1
--- /dev/null   Mon Jun 16 13:17:41 2008
+++ SOURCES/gcc-pr36519.patch   Mon Jun 16 13:17:35 2008
@@ -0,0 +1,121 @@
+2008-06-13  Richard Guenther  <[EMAIL PROTECTED]>
+
+       PR tree-optimization/36519
+       * tree-ssa-alias.c (mem_sym_score): Count call-clobbered
+       unpartitionable SFTs in the usual way.
+       (compute_memory_partitions): Do partition call-clobbered
+       unpartitionable SFTs, but make sure to partition all other
+       SFTs of its parent var into the same partition.
+
+Index: gcc/tree-ssa-alias.c
+===================================================================
+*** gcc/tree-ssa-alias.c       (revision 136743)
+--- gcc/tree-ssa-alias.c       (working copy)
+*************** mem_sym_score (mem_sym_stats_t mp)
+*** 866,872 ****
+       the list.  They are not stored in partitions, but they are used
+       for computing overall statistics.  */
+    if (TREE_CODE (mp->var) == STRUCT_FIELD_TAG
+!       && SFT_UNPARTITIONABLE_P (mp->var))
+      return LONG_MAX;
+  
+    return mp->frequency_writes * 64 + mp->frequency_reads * 32
+--- 866,873 ----
+       the list.  They are not stored in partitions, but they are used
+       for computing overall statistics.  */
+    if (TREE_CODE (mp->var) == STRUCT_FIELD_TAG
+!       && SFT_UNPARTITIONABLE_P (mp->var)
+!       && !is_call_clobbered (mp->var))
+      return LONG_MAX;
+  
+    return mp->frequency_writes * 64 + mp->frequency_reads * 32
+*************** compute_memory_partitions (void)
+*** 1573,1578 ****
+--- 1574,1580 ----
+    VEC(tree,heap) *tags;
+    struct mem_ref_stats_d *mem_ref_stats;
+    int prev_max_aliased_vops;
++   referenced_var_iterator rvi;
+  
+    mem_ref_stats = gimple_mem_ref_stats (cfun);
+    gcc_assert (mem_ref_stats->num_vuses == 0 && mem_ref_stats->num_vdefs == 
0);
+*************** compute_memory_partitions (void)
+*** 1639,1650 ****
+        fields.  See add_vars_for_offset for details.  */
+        if (TREE_CODE (mp_p->var) == STRUCT_FIELD_TAG
+         && SFT_UNPARTITIONABLE_P (mp_p->var))
+!      continue;
+  
+!       mpt = find_partition_for (mp_p);
+        estimate_vop_reduction (mem_ref_stats, mp_p, mpt);
+      }
+  
+    /* After partitions have been created, rewrite alias sets to use
+       them instead of the original symbols.  This way, if the alias set
+       was computed as { a b c d e f }, and the subset { b e f } was
+--- 1641,1705 ----
+        fields.  See add_vars_for_offset for details.  */
+        if (TREE_CODE (mp_p->var) == STRUCT_FIELD_TAG
+         && SFT_UNPARTITIONABLE_P (mp_p->var))
+!      {
+!        subvar_t subvars;
+!        unsigned i;
+!        tree subvar;
+! 
+!        /* For call clobbered we can partition them because we
+!           are sure all subvars end up in the same partition.  */
+!        if (!is_call_clobbered (mp_p->var))
+!          continue;
+! 
+!        mpt = find_partition_for (mp_p);
+!        estimate_vop_reduction (mem_ref_stats, mp_p, mpt);
+! 
+!        /* If we encounter a call-clobbered but unpartitionable SFT
+!           partition all SFTs of its parent variable.  */
+!        subvars = get_subvars_for_var (SFT_PARENT_VAR (mp_p->var));
+!        for (i = 0; VEC_iterate (tree, subvars, i, subvar); ++i)
+!          {
+!            gcc_assert (!var_ann (subvar)->mpt
+!                        || var_ann (subvar)->mpt == mpt);
+!            set_memory_partition (subvar, mpt);
+!            mark_sym_for_renaming (subvar);
+!          }
+  
+!        /* ???  We possibly underestimate the VOP reduction if
+!           we do not encounter all subvars before we are below
+!           the threshold.  We could fix this by sorting in a way
+!           that all subvars of a var appear before all
+!           unpartitionable vars of it.  */
+!        continue;
+!      }
+! 
+!       /* We might encounter an already partitioned symbol due to
+!          the SFT handling above.  Deal with that.  */
+!       if (var_ann (mp_p->var)->mpt)
+!      mpt = var_ann (mp_p->var)->mpt;
+!       else
+!      mpt = find_partition_for (mp_p);
+        estimate_vop_reduction (mem_ref_stats, mp_p, mpt);
+      }
+  
++ #ifdef ENABLE_CHECKING
++   /* For all partitioned unpartitionable subvars make sure all
++      subvars of its parent var are partitioned into the same partition.  */
++   FOR_EACH_REFERENCED_VAR (tag, rvi)
++     if (TREE_CODE (tag) == STRUCT_FIELD_TAG
++      && SFT_UNPARTITIONABLE_P (tag)
++      && var_ann (tag)->mpt != NULL_TREE)
++       {
++      subvar_t subvars;
++      unsigned i;
++      tree subvar;
++ 
++      subvars = get_subvars_for_var (SFT_PARENT_VAR (tag));
++      for (i = 0; VEC_iterate (tree, subvars, i, subvar); ++i)
++        gcc_assert (var_ann (subvar)->mpt == var_ann (tag)->mpt);
++       }
++ #endif
++ 
+    /* After partitions have been created, rewrite alias sets to use
+       them instead of the original symbols.  This way, if the alias set
+       was computed as { a b c d e f }, and the subset { b e f } was
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to