From 6b8dbb533d1711e0ca80c4526a2ef57344d8067c Mon Sep 17 00:00:00 2001 From: irar Date: Wed, 22 Nov 2006 08:46:03 +0000 Subject: * doc/c-tree.texi: Document new tree codes. * doc/md.texi: Document new optabs. * tree-pretty-print.c (dump_generic_node): Handle print of new tree codes. * optabs.c (optab_for_tree_code, init_optabs): Handle new optabs. * optabs.h (optab_index): Add new. (vec_extract_even_optab, vec_extract_odd_optab, vec_interleave_high_optab, vec_interleave_low_optab): New optabs. * genopinit.c (vec_extract_even_optab, vec_extract_odd_optab, vec_interleave_high_optab, vec_interleave_low_optab): Initialize new optabs. * expr.c (expand_expr_real_1): Add implementation for new tree codes. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (stmt_vec_info): Add new fields for interleaving along with macros for their access. * tree-data-ref.h (first_location_in_loop, data_reference): Update comment. * tree-vect-analyze.c (toplev.h): Include. (vect_determine_vectorization_factor): Fix indentation. (vect_insert_into_interleaving_chain, vect_update_interleaving_chain, vect_equal_offsets): New functions. (vect_analyze_data_ref_dependence): Add argument for interleaving check. Check for interleaving if it's true. (vect_check_dependences): New function. (vect_analyze_data_ref_dependences): Call vect_check_dependences for every ddr. Call vect_analyze_data_ref_dependence with new argument. (vect_update_misalignment_for_peel): Update for interleaving. (vect_verify_datarefs_alignment): Check only first data-ref for interleaving. (vect_enhance_data_refs_alignment): Update for interleaving. Check only first data-ref for interleaving. (vect_analyze_data_ref_access): Check interleaving, update interleaving data. (vect_analyze_data_refs): Call compute_data_dependences_for_loop with different parameters. * tree.def (VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR, VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): New tree codes. * tree-inline.c (estimate_num_insns_1): Add cases for new codes. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Update step in case of interleaving. (vect_strided_store_supported, vect_permute_store_chain): New functions. (vectorizable_store): Handle strided stores. (vect_strided_load_supported, vect_permute_load_chain, vect_transform_strided_load): New functions. (vectorizable_load): Handle strided loads. (vect_transform_stmt): Add argument. Handle strided stores. Check that vectorized stmt exists for patterns. (vect_gen_niters_for_prolog_loop): Update calculation for interleaving. (vect_transform_loop): Remove stmt_vec_info for strided stores after whole chain vectorization. * config/rs6000/altivec.md (UNSPEC_EXTEVEN, UNSPEC_EXTODD, UNSPEC_INTERHI, UNSPEC_INTERLO): New constants. (vpkuhum_nomode, vpkuwum_nomode, vec_extract_even, vec_extract_odd, altivec_vmrghsf, altivec_vmrglsf, vec_interleave_high, vec_interleave_low): Implement. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119088 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-data-ref.h | 56 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 13 deletions(-) (limited to 'gcc/tree-data-ref.h') diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h index 7d6f9f94cb4..d80be31e3d0 100644 --- a/gcc/tree-data-ref.h +++ b/gcc/tree-data-ref.h @@ -24,25 +24,27 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #include "lambda.h" -/** {base_address + offset + init} is the first location accessed by data-ref - in the loop, and step is the stride of data-ref in the loop in bytes; - e.g.: - +/* + The first location accessed by data-ref in the loop is the address of data-ref's + base (BASE_ADDRESS) plus the initial offset from the base. We divide the initial offset + into two parts: loop invariant offset (OFFSET) and constant offset (INIT). + STEP is the stride of data-ref in the loop in bytes. + Example 1 Example 2 data-ref a[j].b[i][j] a + x + 16B (a is int*) -First location info: + First location info: base_address &a a - offset j_0*D_j + i_0*D_i + C_a x - init C_b 16 + offset j_0*D_j + i_0*D_i x + init C_b + C_a 16 step D_j 4 access_fn NULL {16, +, 1} -Base object info: + Base object info: base_object a NULL access_fn NULL - **/ + */ struct first_location_in_loop { tree base_address; @@ -51,7 +53,6 @@ struct first_location_in_loop tree step; /* Access function related to first location in the loop. */ VEC(tree,heap) *access_fns; - }; struct base_object_info @@ -97,10 +98,39 @@ struct data_reference struct ptr_info_def *ptr_info; subvar_t subvars; - /* Alignment information. */ - /* The offset of the data-reference from its base in bytes. */ + /* Alignment information. + MISALIGNMENT is the offset of the data-reference from its base in bytes. + ALIGNED_TO is the maximum data-ref's alignment. + + Example 1, + for i + for (j = 3; j < N; j++) + a[j].b[i][j] = 0; + + For a[j].b[i][j], the offset from base (calculated in get_inner_reference() + will be 'i * C_i + j * C_j + C'. + We try to substitute the variables of the offset expression + with initial_condition of the corresponding access_fn in the loop. + 'i' cannot be substituted, since its access_fn in the inner loop is i. 'j' + will be substituted with 3. + + Example 2 + for (j = 3; j < N; j++) + a[j].b[5][j] = 0; + + Here the offset expression (j * C_j + C) will not contain variables after + subsitution of j=3 (3*C_j + C). + + Misalignment can be calculated only if all the variables can be + substituted with constants, otherwise, we record maximum possible alignment + in ALIGNED_TO. In Example 1, since 'i' cannot be substituted, + MISALIGNMENT will be NULL_TREE, and the biggest divider of C_i (a power of + 2) will be recorded in ALIGNED_TO. + + In Example 2, MISALIGNMENT will be the value of 3*C_j + C in bytes, and + ALIGNED_TO will be NULL_TREE. + */ tree misalignment; - /* The maximum data-ref's alignment. */ tree aligned_to; /* The type of the data-ref. */ -- cgit v1.2.1