diff options
author | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-19 18:01:51 +0000 |
---|---|---|
committer | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-19 18:01:51 +0000 |
commit | 9ce81338320f5a7e7df4a3c0179f2d4d8b12fd1f (patch) | |
tree | f964f19e04649f4ccaa0fd898211cec33894eb32 /gcc/tree-chrec.c | |
parent | 615dd397c37bcd1d50f3b13227eb2fb4f2edb237 (diff) | |
download | gcc-9ce81338320f5a7e7df4a3c0179f2d4d8b12fd1f.tar.gz |
2004-09-19 Ira Rosen <irar@il.ibm.com>
* tree-vectorizer.h (stmt_vec_info): Add vect_dr_base field.
(STMT_VINFO_VECT_DR_BASE): Declare.
(VECT_SMODULO): Declare.
* tree-vectorizer.c (vect_compute_array_ref_alignment): New function.
(vect_compute_array_base_alignment): New function.
(vect_analyze_data_ref_access): Check array indices. Remove one
dimensional arrays restriction.
(vect_get_ptr_offset): New function.
(vect_get_symbl_and_dr): New function.
(vect_get_base_and_bit_offset): Support additional data refs. Renamed
(former name vect_get_base_decl_and_bit_offset).
(vect_create_index_for_array_ref): Removed.
(vect_create_index_for_vector_ref): New function.
(vect_create_addr_base_for_vector_ref): New function.
(vect_create_data_ref): Handle additional data refs. Call
vect_create_index_for_vector_ref and vect_create_addr_base_for_vector_ref.
(vect_compute_data_ref_alignment): Support the changes. Call
vect_get_base_and_bit_offset.
(vect_analyze_data_refs): Call vect_get_symbl_and_dr. Support additional
data refs. Store vect_dr_base.
(vect_analyze_data_ref_accesses): Support nonconstant init.
(new_stmt_vec_info): Initialize vect_dr_base field.
(vect_is_simple_iv_evolution): Call initial_condition_in_loop_num.
(get_vectype_for_scalar_type): Check for BLKmode.
* tree-chrec.h (initial_condition_in_loop_num): Declare.
* tree-chrec.c (initial_condition_in_loop_num): New function.
(chrec_component_in_loop_num): New function.
(evolution_part_in_loop_num): Call chrec_component_in_loop_num.
* tree-data-ref.c (analyze_array_indexes): Change parameter (access_fns)
to be pointer to varray_type.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87731 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r-- | gcc/tree-chrec.c | 60 |
1 files changed, 48 insertions, 12 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c index 47419c2c3d7..2d48093c0e2 100644 --- a/gcc/tree-chrec.c +++ b/gcc/tree-chrec.c @@ -583,14 +583,16 @@ hide_evolution_in_other_loops_than_loop (tree chrec, } } -/* Returns the evolution part in LOOP_NUM. Example: the call - get_evolution_in_loop (1, {{0, +, 1}_1, +, 2}_1) returns - {1, +, 2}_1 */ +/* Returns the evolution part of CHREC in LOOP_NUM when RIGHT is + true, otherwise returns the initial condition in LOOP_NUM. */ -tree -evolution_part_in_loop_num (tree chrec, - unsigned loop_num) +static tree +chrec_component_in_loop_num (tree chrec, + unsigned loop_num, + bool right) { + tree component; + if (automatically_generated_chrec_p (chrec)) return chrec; @@ -599,15 +601,22 @@ evolution_part_in_loop_num (tree chrec, case POLYNOMIAL_CHREC: if (CHREC_VARIABLE (chrec) == loop_num) { + if (right) + component = CHREC_RIGHT (chrec); + else + component = CHREC_LEFT (chrec); + if (TREE_CODE (CHREC_LEFT (chrec)) != POLYNOMIAL_CHREC || CHREC_VARIABLE (CHREC_LEFT (chrec)) != CHREC_VARIABLE (chrec)) - return CHREC_RIGHT (chrec); + return component; else return build_polynomial_chrec (loop_num, - evolution_part_in_loop_num (CHREC_LEFT (chrec), loop_num), - CHREC_RIGHT (chrec)); + chrec_component_in_loop_num (CHREC_LEFT (chrec), + loop_num, + right), + component); } else if (CHREC_VARIABLE (chrec) < loop_num) @@ -615,13 +624,40 @@ evolution_part_in_loop_num (tree chrec, return NULL_TREE; else - return evolution_part_in_loop_num (CHREC_LEFT (chrec), loop_num); + return chrec_component_in_loop_num (CHREC_LEFT (chrec), + loop_num, + right); - default: - return NULL_TREE; + default: + if (right) + return NULL_TREE; + else + return chrec; } } +/* Returns the evolution part in LOOP_NUM. Example: the call + evolution_part_in_loop_num (1, {{0, +, 1}_1, +, 2}_1) returns + {1, +, 2}_1 */ + +tree +evolution_part_in_loop_num (tree chrec, + unsigned loop_num) +{ + return chrec_component_in_loop_num (chrec, loop_num, true); +} + +/* Returns the initial condition in LOOP_NUM. Example: the call + initial_condition_in_loop_num ({{0, +, 1}_1, +, 2}_2, 1) returns + {0, +, 1}_1 */ + +tree +initial_condition_in_loop_num (tree chrec, + unsigned loop_num) +{ + return chrec_component_in_loop_num (chrec, loop_num, false); +} + /* Set or reset the evolution of CHREC to NEW_EVOL in loop LOOP_NUM. This function is essentially used for setting the evolution to chrec_dont_know, for example after having determined that it is |