This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tuples] Compact tuple fields


Hi,
with this patch:

Index: gimplify.c
===================================================================
--- gimplify.c	(revision 136579)
+++ gimplify.c	(working copy)
@@ -4218,17 +4218,15 @@ gimplify_modify_expr (tree *expr_p, gimp
       SET_DECL_DEBUG_EXPR (*from_p, *to_p);
    }
 
-  /* FIXME tuples.  Are the calls to unshare_expr really necessary
-     here? */
   if (TREE_CODE (*from_p) == CALL_EXPR)
     {
       /* Since the RHS is a CALL_EXPR, we need to create a GIMPLE_CALL
 	 instead of a GIMPLE_ASSIGN.  */
       assign = gimple_build_call_from_tree (*from_p);
-      gimple_call_set_lhs (assign, unshare_expr (*to_p));
+      gimple_call_set_lhs (assign, *to_p);
     }
   else
-    assign = gimple_build_assign (unshare_expr (*to_p), unshare_expr (*from_p));
+    assign = gimple_build_assign (*to_p, *from_p);
 
   gimplify_seq_add_stmt (pre_p, assign);
 
(I am testing it to see where things breaks ;)
I now get sane memory usage

langhooks.c:548 (add_builtin_function)                    0: 0.0%          0: 0.0%     161568: 2.3%      17952: 3.0%       1122
cfg.c:230 (connect_dest)                               9128: 0.1%      14656: 9.3%     167096: 2.4%      23324: 3.9%       5526
c-decl.c:6025 (build_enumerator)                          0: 0.0%          0: 0.0%     168924: 2.4%       8044: 1.4%       2011
gimple-low.c:808 (record_vars_into)                       0: 0.0%          0: 0.0%     175224: 2.5%          0: 0.0%       6258
stringpool.c:57 (stringpool_ggc_alloc)                 3707: 0.1%          0: 0.0%     176152: 2.6%      20035: 3.4%       9770
gimple.c:443 (gimple_build_cond)                       2340: 0.0%          0: 0.0%     181560: 2.6%      12260: 2.1%       3065
tree.c:5804 (build_function_type)                    487404: 7.0%          0: 0.0%     198612: 2.9%      25408: 4.3%       6352
gimple-iterator.c:447 (gsi_insert_after_without_     101448: 1.5%          0: 0.0%     208308: 3.0%          0: 0.0%      25813
cfg.c:142 (alloc_block)                               18000: 0.3%          0: 0.0%     291900: 4.2%          0: 0.0%       5165
cfg.c:284 (unchecked_make_edge)                           0: 0.0%      12720: 8.1%     324360: 4.7%          0: 0.0%       8427
c-decl.c:4807 (grokdeclarator)                        41184: 0.6%          0: 0.0%     419904: 6.1%      51232: 8.6%       3202
gimplify.c:526 (create_tmp_var_raw)                    8272: 0.1%          0: 0.0%     491920: 7.1%          0: 0.0%       5684
stringpool.c:74 (alloc_node)                          19320: 0.3%          0: 0.0%     566880: 8.2%      39080: 6.6%       9770
tree-inline.c:3530 (copy_tree_r)                     247412: 3.6%          0: 0.0%     678472: 9.8%       3752: 0.6%      23917
gimplify.c:4229 (gimplify_modify_expr)                18016: 0.3%          0: 0.0%     753476:10.9%          0: 0.0%      12712
Total                                               6959113           157204          6903667           594160           324038
source location                                     Garbage            Freed             Leak         Overhead            Times
-------------------------------------------------------

Compared to mainline

gimple-low.c:740 (record_vars_into)                       0: 0.0%          0: 0.0%     175700: 2.3%          0: 0.0%       6275
stringpool.c:57 (stringpool_ggc_alloc)                 3707: 0.1%          0: 0.0%     176408: 2.3%      20163: 3.9%       9770
tree.c:5791 (build_function_type)                    487404: 7.1%          0: 0.0%     198612: 2.6%      25408: 4.9%       6352
tree-iterator.c:168 (tsi_link_after)                 186924: 2.7%          0: 0.0%     209412: 2.8%          0: 0.0%      33028
cfg.c:142 (alloc_block)                               10920: 0.2%          0: 0.0%     292380: 3.9%          0: 0.0%       5055
cfg.c:280 (unchecked_make_edge)                           0: 0.0%       7680: 5.5%     324680: 4.3%          0: 0.0%       8309
c-decl.c:4802 (grokdeclarator)                        32032: 0.5%          0: 0.0%     326592: 4.3%          0: 0.0%       3202
gimplify.c:3789 (tree_to_gimple_tuple)                 8820: 0.1%          0: 0.0%     369656: 4.9%          0: 0.0%      13517
stringpool.c:74 (alloc_node)                          16744: 0.2%          0: 0.0%     491296: 6.5%          0: 0.0%       9770
gimplify.c:473 (create_tmp_var_raw)                    8272: 0.1%          0: 0.0%     493768: 6.5%          0: 0.0%       5705
tree-dfa.c:189 (create_stmt_ann)                     375804: 5.5%          0: 0.0%     907816:12.0%          0: 0.0%      24685
tree-inline.c:3088 (copy_tree_r)                      17592: 0.3%          0: 0.0%     969108:12.8%      33776: 6.6%      23941
Total                                               6885417           139948          7546943           514516           347381
source location                                     Garbage            Freed             Leak         Overhead            Times
-------------------------------------------------------

Obviously the GENERIC bodies are not getting released after
gimplification so we don't save memory footprint much, but 7.5MB->6.9MB
is already improvement.  Similarly there is now improvement on overall
compilation memory usage.
We still produce more BBs, more statements etc.  I am looking into if
inlining is the cause possibly.

I will look into if I can figure out where the nongimplified bodies
dangle.

Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]