diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-04 17:57:29 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-04 17:57:29 +0000 |
commit | 48ff1d417d4c49525c09b013395e38dda8bd50fe (patch) | |
tree | ffb4ea05f14bc936b5dd3681e19b2aa3cee8c3bf /gcc/tree-data-ref.c | |
parent | 144409bbbdb293946cea105115e0e329f633d333 (diff) | |
download | gcc-48ff1d417d4c49525c09b013395e38dda8bd50fe.tar.gz |
2014-01-04 Basile Starynkevitch <basile@starynkevitch.net>
{{merge using svnmerge.py with trunk GCC 4.9 svn rev206333 now in
stage 3; very unstable, xtramelt-ana-base don't compile
anymore...}}
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@206336 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r-- | gcc/tree-data-ref.c | 93 |
1 files changed, 61 insertions, 32 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index fef6a716b7a..91601effccd 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -1,5 +1,5 @@ /* Data references and dependences detectors. - Copyright (C) 2003-2013 Free Software Foundation, Inc. + Copyright (C) 2003-2014 Free Software Foundation, Inc. Contributed by Sebastian Pop <pop@cri.ensmp.fr> This file is part of GCC. @@ -4320,8 +4320,8 @@ compute_all_dependences (vec<data_reference_p> datarefs, typedef struct data_ref_loc_d { - /* Position of the memory reference. */ - tree *pos; + /* The memory reference. */ + tree ref; /* True if the memory reference is read. */ bool is_read; @@ -4336,7 +4336,7 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references) { bool clobbers_memory = false; data_ref_loc ref; - tree *op0, *op1; + tree op0, op1; enum gimple_code stmt_code = gimple_code (stmt); /* ASM_EXPR and CALL_EXPR may embed arbitrary side effects. @@ -4346,16 +4346,26 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references) && !(gimple_call_flags (stmt) & ECF_CONST)) { /* Allow IFN_GOMP_SIMD_LANE in their own loops. */ - if (gimple_call_internal_p (stmt) - && gimple_call_internal_fn (stmt) == IFN_GOMP_SIMD_LANE) - { - struct loop *loop = gimple_bb (stmt)->loop_father; - tree uid = gimple_call_arg (stmt, 0); - gcc_assert (TREE_CODE (uid) == SSA_NAME); - if (loop == NULL - || loop->simduid != SSA_NAME_VAR (uid)) + if (gimple_call_internal_p (stmt)) + switch (gimple_call_internal_fn (stmt)) + { + case IFN_GOMP_SIMD_LANE: + { + struct loop *loop = gimple_bb (stmt)->loop_father; + tree uid = gimple_call_arg (stmt, 0); + gcc_assert (TREE_CODE (uid) == SSA_NAME); + if (loop == NULL + || loop->simduid != SSA_NAME_VAR (uid)) + clobbers_memory = true; + break; + } + case IFN_MASK_LOAD: + case IFN_MASK_STORE: + break; + default: clobbers_memory = true; - } + break; + } else clobbers_memory = true; } @@ -4369,15 +4379,15 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references) if (stmt_code == GIMPLE_ASSIGN) { tree base; - op0 = gimple_assign_lhs_ptr (stmt); - op1 = gimple_assign_rhs1_ptr (stmt); + op0 = gimple_assign_lhs (stmt); + op1 = gimple_assign_rhs1 (stmt); - if (DECL_P (*op1) - || (REFERENCE_CLASS_P (*op1) - && (base = get_base_address (*op1)) + if (DECL_P (op1) + || (REFERENCE_CLASS_P (op1) + && (base = get_base_address (op1)) && TREE_CODE (base) != SSA_NAME)) { - ref.pos = op1; + ref.ref = op1; ref.is_read = true; references->safe_push (ref); } @@ -4386,16 +4396,35 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references) { unsigned i, n; - op0 = gimple_call_lhs_ptr (stmt); + ref.is_read = false; + if (gimple_call_internal_p (stmt)) + switch (gimple_call_internal_fn (stmt)) + { + case IFN_MASK_LOAD: + ref.is_read = true; + case IFN_MASK_STORE: + ref.ref = fold_build2 (MEM_REF, + ref.is_read + ? TREE_TYPE (gimple_call_lhs (stmt)) + : TREE_TYPE (gimple_call_arg (stmt, 3)), + gimple_call_arg (stmt, 0), + gimple_call_arg (stmt, 1)); + references->safe_push (ref); + return false; + default: + break; + } + + op0 = gimple_call_lhs (stmt); n = gimple_call_num_args (stmt); for (i = 0; i < n; i++) { - op1 = gimple_call_arg_ptr (stmt, i); + op1 = gimple_call_arg (stmt, i); - if (DECL_P (*op1) - || (REFERENCE_CLASS_P (*op1) && get_base_address (*op1))) + if (DECL_P (op1) + || (REFERENCE_CLASS_P (op1) && get_base_address (op1))) { - ref.pos = op1; + ref.ref = op1; ref.is_read = true; references->safe_push (ref); } @@ -4404,11 +4433,11 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references) else return clobbers_memory; - if (*op0 - && (DECL_P (*op0) - || (REFERENCE_CLASS_P (*op0) && get_base_address (*op0)))) + if (op0 + && (DECL_P (op0) + || (REFERENCE_CLASS_P (op0) && get_base_address (op0)))) { - ref.pos = op0; + ref.ref = op0; ref.is_read = false; references->safe_push (ref); } @@ -4424,7 +4453,7 @@ find_data_references_in_stmt (struct loop *nest, gimple stmt, vec<data_reference_p> *datarefs) { unsigned i; - stack_vec<data_ref_loc, 2> references; + auto_vec<data_ref_loc, 2> references; data_ref_loc *ref; bool ret = true; data_reference_p dr; @@ -4435,7 +4464,7 @@ find_data_references_in_stmt (struct loop *nest, gimple stmt, FOR_EACH_VEC_ELT (references, i, ref) { dr = create_data_ref (nest, loop_containing_stmt (stmt), - *ref->pos, stmt, ref->is_read); + ref->ref, stmt, ref->is_read); gcc_assert (dr != NULL); datarefs->safe_push (dr); } @@ -4454,7 +4483,7 @@ graphite_find_data_references_in_stmt (loop_p nest, loop_p loop, gimple stmt, vec<data_reference_p> *datarefs) { unsigned i; - stack_vec<data_ref_loc, 2> references; + auto_vec<data_ref_loc, 2> references; data_ref_loc *ref; bool ret = true; data_reference_p dr; @@ -4464,7 +4493,7 @@ graphite_find_data_references_in_stmt (loop_p nest, loop_p loop, gimple stmt, FOR_EACH_VEC_ELT (references, i, ref) { - dr = create_data_ref (nest, loop, *ref->pos, stmt, ref->is_read); + dr = create_data_ref (nest, loop, ref->ref, stmt, ref->is_read); gcc_assert (dr != NULL); datarefs->safe_push (dr); } |