Little memory consumption scores
Jan Hubicka
jh@suse.cz
Wed Sep 1 20:40:00 GMT 2004
Hi,
Here are results of simple memory consumption test relative to 3.4. Via
-fmem-report compilation of combine.i I get "Total Allocated" of 27MB for -O0
and 69MB for -O2, compared to total of 13MB for both -O0 and -O2 at 3.4.
Here is bottom of the list for optimizing compilation:
c-decl.c:431 (bind) 12623 302952 50492:0.457%
gimplify.c:451 (internal_get_tmp_var) 10277 369972 0:0.479%
genrtl.c:671 (gen_rtx_fmt_e0) 32440 389280 0:0.504%
c-decl.c:4503 (grokdeclarator) 3424 397184 0:0.514%
c-typeck.c:1500 (build_component_ref) 10808 432320 0:0.559%
tree-ssa-operands.c:102 (allocate_def_optype) 55525 444200 0:0.575%
tree-phinodes.c:268 (resize_phi_node) 3307 448000 704:0.581%
genrtl.c:635 (gen_rtx_fmt_i00) 28332 453312 0:0.587%
tree-iterator.c:171 (tsi_link_after) 38776 465312 0:0.602%
tree.c:4121 (build_function_type) 4042 468872 97008:0.732%
tree-ssa-operands.c:113 (allocate_use_optype) 65371 584964 2660:0.760%
tree-ssa-dom.c:1781 (record_dominating_conditions) 16437 591732 0:0.766%
tree-ssa-dom.c:1771 (record_dominating_conditions) 16437 591732 0:0.766%
tree-ssa-dom.c:1776 (record_dominating_conditions) 16437 591732 0:0.766%
emit-rtl.c:3437 (make_jump_insn_raw) 7749 495936 154980:0.842%
c-parse.y:755 (yyparse) 27780 666720 0:0.863%
cfg.c:172 (initialize_bb_rbi) 21230 679360 84920:0.989%
convert.c:455 (convert_to_integer) 24251 776032 0:1.004%
cselib.c:839 (cselib_subst_to_values) 67068 782732 0:1.013%
tree-dfa.c:419 (create_var_ann) 9623 615872 192460:1.046%
c-decl.c:4443 (grokdeclarator) 7865 912340 0:1.180%
tree.c:430 (build_int_2) 38889 933336 0:1.208%
emit-rtl.c:3405 (make_insn_raw) 25106 1004240 0:1.299%
gimplify.c:323 (create_tmp_var_raw) 8707 1010012 0:1.307%
tree-ssa-operands.c:124 (allocate_v_may_def_optype) 8504 856076 208340:1.377%
bitmap.c:719 (bitmap_initialize) 66766 1068256 0:1.382%
ggc-common.c:190 (ggc_calloc) 1252 877916 205440:1.402%
genrtl.c:51 (gen_rtx_fmt_ue) 104293 1251516 0:1.619%
cfg.c:238 (unchecked_make_edge) 16799 1075136 268784:1.739%
gimplify.c:281 (create_artificial_label) 12040 1396640 0:1.807%
tree-dfa.c:334 (add_immediate_use) 117512 1410144 0:1.825%
stringpool.c:76 (alloc_node) 18432 1179648 294912:1.908%
tree-ssanames.c:151 (make_ssa_name) 45091 1623276 0:2.100%
rtl.c:249 (copy_rtx) 142767 1647836 0:2.132%
tree-phinodes.c:194 (make_phi_node) 12118 1612352 72624:2.180%
fold-const.c:2925 (invert_truthvalue) 46979 1691244 0:2.188%
cfg.c:160 (alloc_block) 13001 1508116 260020:2.288%
genrtl.c:33 (gen_rtx_fmt_ee) 199794 2397528 0:3.102%
bitmap.c:145 (bitmap_element_allocate) 85256 2728192 341024:3.971%
tree-dfa.c:444 (create_stmt_ann) 79843 5109952 958116:7.852%
varray.c:131 (varray_init) 71555 5655280 1046320:8.671%
varray.c:164 (varray_grow) 42467 9393164 3343180:16.480%
and non-optimizing:
c-decl.c:5659 (build_enumerator) 2619 62856 0:0.212%
c-typeck.c:1888 (build_function_call) 1572 62880 0:0.212%
tree.c:3866 (build_pointer_type_for_mode) 495 57420 11880:0.233%
tree.c:2666 (annotate_with_file_line) 8672 69376 0:0.234%
fold-const.c:1913 (fold_convert) 2170 69440 0:0.234%
c-decl.c:6617 (make_pointer_declarator) 2216 70912 0:0.239%
convert.c:669 (convert_to_integer) 2317 74144 0:0.250%
genrtl.c:688 (gen_rtx_fmt_u00) 4850 77600 0:0.261%
genrtl.c:236 (gen_rtx_fmt_e) 10372 82976 0:0.279%
c-decl.c:4787 (get_parm_info) 3606 86544 0:0.291%
c-typeck.c:2067 (convert_arguments) 4058 97392 0:0.328%
fold-const.c:1681 (size_binop) 2709 97524 0:0.328%
emit-rtl.c:5163 (init_emit) 69 70656 27048:0.329%
c-decl.c:2492 (builtin_function) 852 98832 0:0.333%
c-parse.y:1050 (yyparse) 4148 99552 0:0.335%
c-parse.y:957 (yyparse) 4193 100632 0:0.339%
gimple-low.c:360 (lower_cond_expr) 3147 100704 0:0.339%
gimple-low.c:350 (lower_cond_expr) 3147 100704 0:0.339%
tree.c:5519 (build_empty_stmt) 3154 100928 0:0.340%
tree-cfg.c:291 (create_block_annotation) 6989 111824 0:0.376%
function.c:3777 (allocate_struct_function) 158 80896 37920:0.400%
gimple-low.c:467 (record_vars) 5261 126264 0:0.425%
emit-rtl.c:3458 (make_call_insn_raw) 1509 96576 30180:0.427%
rtl.c:158 (rtvec_alloc) 10410 131772 1760:0.450%
c-decl.c:4480 (grokdeclarator) 1239 143724 0:0.484%
c-decl.c:4606 (grokdeclarator) 1249 144884 0:0.488%
emit-rtl.c:4352 (emit_note_after) 4908 157056 0:0.529%
tree.c:2550 (build_nt) 3827 157808 4020:0.545%
c-typeck.c:1543 (build_indirect_ref) 5147 164704 0:0.554%
emit-rtl.c:737 (gen_reg_rtx) 39 120832 46256:0.563%
optabs.c:5022 (new_convert_optab) 9 147456 20412:0.565%
genrtl.c:478 (gen_rtx_fmt_iuuB00is) 4829 173844 0:0.585%
c-decl.c:4874 (get_parm_info) 7539 180936 0:0.609%
emit-rtl.c:1464 (component_ref_for_mem_expr) 4918 196720 0:0.662%
emit-rtl.c:315 (get_mem_attrs) 7605 182520 30420:0.717%
tree-iterator.c:47 (alloc_stmt_list) 9582 229968 0:0.774%
cfg.c:172 (initialize_bb_rbi) 6855 219360 27420:0.831%
c-parse.y:1831 (yyparse) 10600 254400 0:0.856%
c-typeck.c:1430 (lookup_field) 10808 259392 0:0.873%
c-parse.y:873 (yyparse) 11499 275976 0:0.929%
gimplify.c:1235 (build_and_jump) 8662 277184 0:0.933%
ggc-common.c:190 (ggc_calloc) 592 280416 2720:0.953%
c-decl.c:5655 (build_enumerator) 2619 303804 0:1.023%
c-typeck.c:1653 (build_array_ref) 3880 248320 77600:1.097%
c-typeck.c:7559 (build_binary_op) 9195 331020 0:1.114%
c-decl.c:431 (bind) 12699 304776 50796:1.197%
emit-rtl.c:3437 (make_jump_insn_raw) 4283 274112 85660:1.211%
gimplify.c:451 (internal_get_tmp_var) 10311 371196 0:1.250%
c-decl.c:4503 (grokdeclarator) 3424 397184 0:1.337%
tree-iterator.c:171 (tsi_link_after) 34878 418536 0:1.409%
c-typeck.c:1500 (build_component_ref) 10808 432320 0:1.455%
emit-rtl.c:5040 (copy_insn_1) 39958 471020 0:1.586%
tree.c:430 (build_int_2) 19953 478872 0:1.612%
genrtl.c:635 (gen_rtx_fmt_i00) 31475 503600 0:1.695%
genrtl.c:671 (gen_rtx_fmt_e0) 42037 504444 0:1.698%
emit-rtl.c:2570 (copy_rtx_if_shared_1) 46016 552192 0:1.859%
gimplify.c:323 (create_tmp_var_raw) 4801 556916 0:1.875%
tree.c:4121 (build_function_type) 4042 468872 97008:1.905%
c-parse.y:755 (yyparse) 27780 666720 0:2.245%
varray.c:131 (varray_init) 1235 540000 157036:2.347%
convert.c:455 (convert_to_integer) 23797 761504 0:2.564%
cfg.c:238 (unchecked_make_edge) 10738 687232 171808:2.892%
c-decl.c:4443 (grokdeclarator) 7865 912340 0:3.071%
gimplify.c:281 (create_artificial_label) 8066 935656 0:3.150%
cfg.c:160 (alloc_block) 7139 828124 142780:3.269%
rtl.c:249 (copy_rtx) 97395 1161024 0:3.909%
stringpool.c:76 (alloc_node) 14526 929664 232416:3.912%
varray.c:164 (varray_grow) 652 932368 234772:3.929%
genrtl.c:33 (gen_rtx_fmt_ee) 124270 1491240 0:5.020%
emit-rtl.c:3405 (make_insn_raw) 39350 1574000 0:5.299%
tree-dfa.c:444 (create_stmt_ann) 28053 1795392 336636:7.178%
Total 934313 27735668 1967974
I will send patches for explicitly ggc_freeing the most memory consuming
items (annotations and some of varrays). The situation might be
somewhat better than it looks from the stats as we do some amount of ggc
freeing. I used to have patch to track down every memory allocation and
figure out how long it lived and whether it has been explicitely
released. I hope to dig it out and send shortly.
Also the invert_truthvalue is getting very top in the profiles. Most
of the calls seems to be comming from tree-ssa-dom tracking code. Jeff,
perhaps you can avoud actually inverting the expressions or invent some
kind of caching?
Hope to have more tomorrow.
Honza
More information about the Gcc
mailing list