diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-31 02:37:11 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-31 02:37:11 +0000 |
commit | c794d7381e300af2b0e33fcfa014731b3f613f80 (patch) | |
tree | a11ead2860cb37efe5f1938390042efa5755bbc6 /gcc/tree-data-ref.c | |
parent | 5df4cc8d665d4429818e288de3ea68c3b233a85a (diff) | |
download | gcc-c794d7381e300af2b0e33fcfa014731b3f613f80.tar.gz |
Add a new driver to data reference analysis.
2009-07-30 Sebastian Pop <sebastian.pop@amd.com>
* tree-data-ref.c (graphite_find_data_references_in_stmt): New.
* tree-data-ref.h (graphite_find_data_references_in_stmt): Declared.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150297 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r-- | gcc/tree-data-ref.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 2e515bfe0f6..ae0a0681479 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -4158,6 +4158,37 @@ find_data_references_in_stmt (struct loop *nest, gimple stmt, return ret; } +/* Stores the data references in STMT to DATAREFS. If there is an unanalyzable + reference, returns false, otherwise returns true. NEST is the outermost + loop of the loop nest in which the references should be analyzed. */ + +bool +graphite_find_data_references_in_stmt (struct loop *nest, gimple stmt, + VEC (data_reference_p, heap) **datarefs) +{ + unsigned i; + VEC (data_ref_loc, heap) *references; + data_ref_loc *ref; + bool ret = true; + data_reference_p dr; + + if (get_references_in_stmt (stmt, &references)) + { + VEC_free (data_ref_loc, heap, references); + return false; + } + + for (i = 0; VEC_iterate (data_ref_loc, references, i, ref); i++) + { + dr = create_data_ref (nest, *ref->pos, stmt, ref->is_read); + gcc_assert (dr != NULL); + VEC_safe_push (data_reference_p, heap, *datarefs, dr); + } + + VEC_free (data_ref_loc, heap, references); + return ret; +} + /* Search the data references in LOOP, and record the information into DATAREFS. Returns chrec_dont_know when failing to analyze a difficult case, returns NULL_TREE otherwise. */ |