aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-analyze.c
diff options
context:
space:
mode:
authorDorit Nuzman <dorit@gcc.gnu.org>2005-03-29 16:10:22 +0000
committerDorit Nuzman <dorit@gcc.gnu.org>2005-03-29 16:10:22 +0000
commit8bb46326fbe9a12661c8d936622ef09dee0eb6d9 (patch)
tree3b6e04f8be928ef4cb17b708c1898650d3020a60 /gcc/tree-vect-analyze.c
parent1a612e0a6cc76824017ca688693c9340114f1a76 (diff)
downloadgcc-8bb46326fbe9a12661c8d936622ef09dee0eb6d9.zip
gcc-8bb46326fbe9a12661c8d936622ef09dee0eb6d9.tar.gz
gcc-8bb46326fbe9a12661c8d936622ef09dee0eb6d9.tar.bz2
tree-ssanames.c (duplicate_ssa_name_ptr_info): New function.
* tree-ssanames.c (duplicate_ssa_name_ptr_info): New function. (duplicate_ssa_name): Call duplicate_ssa_name_ptr_info. * tree-vect-analyze.c (vect_object_analysis): additional parm pass back a "struct ptr_info_def *" with the points-to info. (vect_analyze_data_refs): set the STMT_VINFO_PTR_INFO for the statement using info returned from vect_object_analysis. * tree-vect-transform.c (update_vuses_to_preheader): New function. (vect_create_data_ref_ptr): Remove updates to vars_to_rename for virtual uses and defs when creating a replacement vector reference. Call duplicate_ssa_name_ptr_info to define points-to info for vector pointer replacement using STMT_VINFO_PTR_INFO. (vectorizable_store): copy_virtual_operands and update definition statements. (vectorizable_load): copy_virtual_operands. Remove call to mark_call_clobbered_vars_to_rename for call to "const" builtin. * tree-vectorizer.c (vectorize_loops): Remove calls to rewrite_into_ssa and bitmap_clear (vars_to_rename). (new_stmt_vec_info): initialize STMT_VINFO_PTR_INFO for stmt. * tree-vectorizer.h (_stmt_vec_info): add field ptr_info and define macro STMT_VINFO_PTR_INFO for use in accessing. * tree.h add export of duplicate_ssa_name_ptr_info. * rs6000.c (altivec_init_builtins): Declare builtin function __builtin_altivec_mask_for_load to be "const". From-SVN: r97164
Diffstat (limited to 'gcc/tree-vect-analyze.c')
-rw-r--r--gcc/tree-vect-analyze.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index f3144e1..97ad231 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -71,7 +71,8 @@ static bool vect_base_addr_differ_p (struct data_reference *,
struct data_reference *drb, bool *);
static tree vect_object_analysis (tree, tree, bool, tree,
struct data_reference **, tree *, tree *,
- tree *, bool *, tree *, subvar_t *);
+ tree *, bool *, tree *, struct ptr_info_def **,
+ subvar_t *);
static tree vect_address_analysis (tree, tree, bool, tree,
struct data_reference *, tree *, tree *,
tree *, bool *);
@@ -1476,6 +1477,7 @@ vect_address_analysis (tree expr, tree stmt, bool is_read, tree vectype,
tree oprnd0, oprnd1, base_address, offset_expr, base_addr0, base_addr1;
tree address_offset = ssize_int (0), address_misalign = ssize_int (0);
tree dummy;
+ struct ptr_info_def *dummy1;
subvar_t dummy2;
switch (TREE_CODE (expr))
@@ -1529,7 +1531,7 @@ vect_address_analysis (tree expr, tree stmt, bool is_read, tree vectype,
base_address = vect_object_analysis (TREE_OPERAND (expr, 0), stmt,
is_read, vectype, &dr, offset,
misalign, step, base_aligned,
- &dummy, &dummy2);
+ &dummy, &dummy1, &dummy2);
return base_address;
case SSA_NAME:
@@ -1608,6 +1610,7 @@ vect_address_analysis (tree expr, tree stmt, bool is_read, tree vectype,
STEP - evolution of the DR_REF in the loop
BASE_ALIGNED - indicates if BASE is aligned
MEMTAG - memory tag for aliasing purposes
+ PTR_INFO - NULL or points-to aliasing info from a pointer SSA_NAME
SUBVAR - Sub-variables of the variable
If something unexpected is encountered (an unsupported form of data-ref),
@@ -1618,7 +1621,7 @@ vect_object_analysis (tree memref, tree stmt, bool is_read,
tree vectype, struct data_reference **dr,
tree *offset, tree *misalign, tree *step,
bool *base_aligned, tree *memtag,
- subvar_t *subvars)
+ struct ptr_info_def **ptr_info, subvar_t *subvars)
{
tree base = NULL_TREE, base_address = NULL_TREE;
tree object_offset = ssize_int (0), object_misalign = ssize_int (0);
@@ -1635,6 +1638,8 @@ vect_object_analysis (tree memref, tree stmt, bool is_read,
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
struct data_reference *ptr_dr = NULL;
tree access_fn, evolution_part, address_to_analyze;
+
+ *ptr_info = NULL;
/* Part 1: */
/* Case 1. handled_component_p refs. */
@@ -1722,9 +1727,13 @@ vect_object_analysis (tree memref, tree stmt, bool is_read,
/* Part 1: Case 3. INDIRECT_REFs. */
else if (TREE_CODE (memref) == INDIRECT_REF)
- {
+ {
+ tree ptr_ref = TREE_OPERAND (memref, 0);
+ if (TREE_CODE (ptr_ref) == SSA_NAME)
+ *ptr_info = SSA_NAME_PTR_INFO (ptr_ref);
+
/* 3.1 get the access function. */
- access_fn = analyze_scalar_evolution (loop, TREE_OPERAND (memref, 0));
+ access_fn = analyze_scalar_evolution (loop, ptr_ref);
if (!access_fn)
{
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS,
@@ -1849,7 +1858,7 @@ vect_object_analysis (tree memref, tree stmt, bool is_read,
Call get_inner_reference for refs handled in this function.
Call vect_addr_analysis(addr) to analyze pointer type expressions.
Set ref_stmt.base, ref_stmt.initial_offset, ref_stmt.alignment,
- ref_stmt.memtag and ref_stmt.step accordingly.
+ ref_stmt.memtag, ref_stmt.ptr_info and ref_stmt.step accordingly.
2- vect_analyze_dependences(): apply dependence testing using ref_stmt.DR
3- vect_analyze_drs_alignment(): check that ref_stmt.alignment is ok.
4- vect_analyze_drs_access(): check that ref_stmt.step is ok.
@@ -1887,6 +1896,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo)
tree memref = NULL;
tree scalar_type, vectype;
tree base, offset, misalign, step, tag;
+ struct ptr_info_def *ptr_info;
bool base_aligned;
subvar_t subvars = NULL;
@@ -1952,7 +1962,8 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo)
dr = NULL;
base = vect_object_analysis (memref, stmt, is_read, vectype, &dr,
&offset, &misalign, &step,
- &base_aligned, &tag, &subvars);
+ &base_aligned, &tag, &ptr_info,
+ &subvars);
if (!base)
{
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS,
@@ -1969,6 +1980,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo)
STMT_VINFO_VECT_MISALIGNMENT (stmt_info) = misalign;
STMT_VINFO_VECT_BASE_ALIGNED_P (stmt_info) = base_aligned;
STMT_VINFO_MEMTAG (stmt_info) = tag;
+ STMT_VINFO_PTR_INFO (stmt_info) = ptr_info;
STMT_VINFO_SUBVARS (stmt_info) = subvars;
STMT_VINFO_VECTYPE (stmt_info) = vectype;
VARRAY_PUSH_GENERIC_PTR (*datarefs, dr);