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] |
Hello, Following my message (http://gcc.gnu.org/ml/gcc/2004-08/msg01050.html) regarding variable expansion in the unroller; I enclose the patch for this optimization which also contains register pressure utility. As before; the code includes part of Zdenek Dvorak patch for splitting induction variables because it is not in mainline yet. (http://gcc.gnu.org/ml/gcc-patches/2004-06/msg02425.html) The heuristics which we adopted to estimate the register pressure within a set of basic blocks is as follows: Use the life analysis to record the maximal number of live registers needed in each class and compare it to the number of registers available. The mapping from registers to their classes is written by Vladimir N. Makarov. Bootstrapped (with -funroll-all-loops) & regression tests on POWER4. Comments are welcome, Revital 2004-09-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> Vladimir N. Makarov <vmakarov@redhat.com> Revital Eres <eres@il.ibm.com> * Makefile.in (loop-unroll.o): Add HASHTAB_H, RECOG_H and VARRAY_H dependency. * basic-block.h: (PROP_REG_PRESSURE): New definition for the purpose of the register pressure pass in flow.c. (struct reorder_block_def): Add copy_number field. * cfgloop.h (biv_p): Declare. * cfgloopmanip.c (duplicate_loop_to_header_edge): Set copy_number. * common.opt (fsplit-ivs-in-unroller, fvariable-expansion-in-unroller): New flags. * loop-unroll.c: Include hashtab.h, recog.h and varray.h. (struct iv_to_split, struct var_to_expand, struct opt_info): New types. (analyze_insns_in_loop, opt_info_start_duplication, apply_opt_in_copies, free_opt_info, analyze_insn_to_expand_var, referenced_in_one_insn_in_loop_p, analyze_iv_to_split_insn, expand_var_during_unrolling, insert_var_expansion_initialization, combine_var_copies_in_loop_exit, release_var_copies, calculate_register_pressure): New functions. (peel_loop_completely, unroll_loop_constant_iterations, unroll_loop_runtime_iterations, peel_loop_simple, unroll_loop_stupid): Use them. * flow.c: (available_class_regs_num, live_regclass, max_pressure): New static data-structures to support register pressure estimation. (GET_REG_CLASS): New definition. (update_life_info, init_propagate_block_info, mark_set_1, attempt_auto_inc, mark_used_reg, calculate_global_regs_live, propagate_one_insn): Use them to update register pressure. (set_available_class_regs_num, regno_regclass_change_pressure, regno_increase_pressure, regno_decrease_pressure, init_reg_pressure_analyze, reset_live_regclass, estimate_register_pressure, analyze_register_pressure): New functions to estimate register pressure. * loop-iv.c (biv_p): New function. * doc/invoke.texi: (fsplit-ivs-in-unroller, fvariable-expansion-in-unroller): Document.
Attachment:
diff_12_9
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |