diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2010-08-02 16:20:36 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2010-08-02 16:20:36 +0000 |
commit | 20769d5eb6854f1dec44744721ec17c52609254d (patch) | |
tree | 167b7b8803b20ddb17ea9f205ec3cd9c4746e278 /gcc/tree-data-ref.c | |
parent | ef973f3f4b72e19f6e1354f4cbd9f387bbb7e510 (diff) | |
download | gcc-20769d5eb6854f1dec44744721ec17c52609254d.zip gcc-20769d5eb6854f1dec44744721ec17c52609254d.tar.gz gcc-20769d5eb6854f1dec44744721ec17c52609254d.tar.bz2 |
Add -ftree-loop-distribute-patterns enabled at -O3.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
* common.opt (ftree-loop-distribute-patterns): New.
* invoke.texi (-ftree-loop-distribute-patterns): Documented.
* opts.c (decode_options): Enable flag_tree_loop_distribute_patterns
at -O3.
* tree-data-ref.c (stores_zero_from_loop): New.
* tree-data-ref.h (stores_zero_from_loop): Declared.
* tree-loop-distribution.c (tree_loop_distribution): Call
stores_zero_from_loop.
(tree_loop_distribution): Check flag_tree_loop_distribute_patterns.
From-SVN: r162822
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r-- | gcc/tree-data-ref.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index e7aa277..2656350 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -5038,6 +5038,32 @@ stores_from_loop (struct loop *loop, VEC (gimple, heap) **stmts) free (bbs); } +/* Initialize STMTS with all the statements of LOOP that contain a + store to memory of the form "A[i] = 0". */ + +void +stores_zero_from_loop (struct loop *loop, VEC (gimple, heap) **stmts) +{ + unsigned int i; + basic_block bb; + gimple_stmt_iterator si; + gimple stmt; + tree op; + basic_block *bbs = get_loop_body_in_dom_order (loop); + + for (i = 0; i < loop->num_nodes; i++) + for (bb = bbs[i], si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si)) + if ((stmt = gsi_stmt (si)) + && gimple_vdef (stmt) + && is_gimple_assign (stmt) + && gimple_assign_rhs_code (stmt) == INTEGER_CST + && (op = gimple_assign_rhs1 (stmt)) + && (integer_zerop (op) || real_zerop (op))) + VEC_safe_push (gimple, heap, *stmts, gsi_stmt (si)); + + free (bbs); +} + /* For a data reference REF, return the declaration of its base address or NULL_TREE if the base is not determined. */ |