diff options
author | Bernd Schmidt <bernd.schmidt@analog.com> | 2009-08-09 07:59:12 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2009-08-09 07:59:12 +0000 |
commit | 2c08497af02c674b5f87b988b55f8a79d2e77195 (patch) | |
tree | 737dab8544b1f38d0663f7d5b6a29b3494bcec67 /gcc/tree-dfa.c | |
parent | a9a25daa5cbb49676f5adc25360a76d63848912e (diff) | |
download | gcc-2c08497af02c674b5f87b988b55f8a79d2e77195.zip gcc-2c08497af02c674b5f87b988b55f8a79d2e77195.tar.gz gcc-2c08497af02c674b5f87b988b55f8a79d2e77195.tar.bz2 |
tree-dfa.c (renumber_gimple_stmt_uids_in_blocks): New function.
* tree-dfa.c (renumber_gimple_stmt_uids_in_blocks): New function.
* tree-flow.h (renumber_gimple_stmt_uids_in_blocks): Declare it.
* tree-ssa-loop-ivopts.c (comp_cost): Make COST an integer.
(enum iv_position): Add IP_AFTER_USE and IP_BEFORE_USE.
(dump_cand): Handle them.
(struct iv_cand): New members COST_STEP and AINC_USE.
(stmt_after_increment): Likewise.
(stmt_after_inc_pos): Renamed from stmt_after_ip_original_pos. All
callers changed. Use gimple_uid comparison instead of scanning.
(add_candidate_1): When looking for identical candidates, take
AINC_USE into account. Set it for new candidates.
(force_expr_to_var_cost): Cast target_spill_cost to int.
(get_address_cost): New arguments STMT_AFTER_INC and MAY_AUTOINC.
All callers changed. Check for availability of autoinc addressing
modes, both in general for a given mode, and in the specific use
case.
(get_computation_cost_at): New argument CAN_AUTOINC. All callers
changed.
(get_computation_cost): Likewise.
(autoinc_possible_for_pair, set_autoinc_for_original_candidates,
add_autoinc_candidates): New static functions.
(add_candidate): Call add_autoinc_candidates for candidates based on
a USE_ADDRESS use.
(find_iv_candidates): Call set_autoinc_for_original_candidates.
(determine_use_iv_cost_address): If we have an autoinc candidate at
the matching use, verify autoinc is possible and subtract the cost
of the candidate's step from the cost.
(determine_iv_cost): Record the cost of the increment in the COST_STEP
member of the candidate.
(tree_ssa_iv_optimize_loop): Swap the calls to determine_iv_costs and
determine_use_iv_costs. Call renumber_gimple_stmt_uids_in_blocks.
testsuite/
* gcc.target/bfin/loop-autoinc.c: New file.
From-SVN: r150588
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r-- | gcc/tree-dfa.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 1067a43..4147a28 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -157,6 +157,32 @@ renumber_gimple_stmt_uids (void) } } +/* Like renumber_gimple_stmt_uids, but only do work on the basic blocks + in BLOCKS, of which there are N_BLOCKS. Also renumbers PHIs. */ + +void +renumber_gimple_stmt_uids_in_blocks (basic_block *blocks, int n_blocks) +{ + int i; + + set_gimple_stmt_max_uid (cfun, 0); + for (i = 0; i < n_blocks; i++) + { + basic_block bb = blocks[i]; + gimple_stmt_iterator bsi; + for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi)) + { + gimple stmt = gsi_stmt (bsi); + gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun)); + } + for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi)) + { + gimple stmt = gsi_stmt (bsi); + gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun)); + } + } +} + /* Create a new annotation for a tree T. */ tree_ann_common_t |