diff options
author | Richard Guenther <rguenther@suse.de> | 2010-11-23 09:42:41 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-11-23 09:42:41 +0000 |
commit | 8ea34dabd235e56d7f7c5ce045c755c9abccd880 (patch) | |
tree | d6e170a74c3b147e05b9123cc46161d4cd975ceb /gcc/tree-ssa-alias.c | |
parent | ad234fc7c44096da2c17e0415b567f9699e01360 (diff) | |
download | gcc-8ea34dabd235e56d7f7c5ce045c755c9abccd880.tar.gz |
tree-ssa-sccvn.c (vn_reference_lookup_3): Avoid doing work twice.
2010-11-23 Richard Guenther <rguenther@suse.de>
* tree-ssa-sccvn.c (vn_reference_lookup_3): Avoid doing work
twice. Avoid re-allocating the ops vector all the time.
2010-11-23 Richard Guenther <rguenther@suse.de>
* tree-ssa-alias.c (refs_may_alias_p_1): Avoid calls to
is_gimple_min_invariant, group tree code checks to allow
combining them.
(stmt_may_clobber_ref_p_1): Check for SSA_NAME instead
of is_gimple_reg.
From-SVN: r167072
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index b5af0133079..b340e5fe587 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -1000,21 +1000,23 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p) *D.1663_44 = VIEW_CONVERT_EXPR<struct DB_LSN>(__tmp$B0F64_59); which is seen as a struct copy. */ if (TREE_CODE (base1) == SSA_NAME - || TREE_CODE (base2) == SSA_NAME || TREE_CODE (base1) == CONST_DECL + || TREE_CODE (base1) == CONSTRUCTOR + || TREE_CODE (base1) == ADDR_EXPR + || CONSTANT_CLASS_P (base1) + || TREE_CODE (base2) == SSA_NAME || TREE_CODE (base2) == CONST_DECL - || TREE_CODE (base1) == STRING_CST - || TREE_CODE (base2) == STRING_CST - || is_gimple_min_invariant (base1) - || is_gimple_min_invariant (base2)) + || TREE_CODE (base2) == CONSTRUCTOR + || TREE_CODE (base2) == ADDR_EXPR + || CONSTANT_CLASS_P (base2)) return false; /* We can end up refering to code via function and label decls. As we likely do not properly track code aliases conservatively bail out. */ if (TREE_CODE (base1) == FUNCTION_DECL - || TREE_CODE (base2) == FUNCTION_DECL || TREE_CODE (base1) == LABEL_DECL + || TREE_CODE (base2) == FUNCTION_DECL || TREE_CODE (base2) == LABEL_DECL) return true; @@ -1572,7 +1574,7 @@ stmt_may_clobber_ref_p_1 (gimple stmt, ao_ref *ref) { tree lhs = gimple_call_lhs (stmt); if (lhs - && !is_gimple_reg (lhs)) + && TREE_CODE (lhs) != SSA_NAME) { ao_ref r; ao_ref_init (&r, lhs); @@ -1585,10 +1587,10 @@ stmt_may_clobber_ref_p_1 (gimple stmt, ao_ref *ref) else if (gimple_assign_single_p (stmt)) { tree lhs = gimple_assign_lhs (stmt); - if (!is_gimple_reg (lhs)) + if (TREE_CODE (lhs) != SSA_NAME) { ao_ref r; - ao_ref_init (&r, gimple_assign_lhs (stmt)); + ao_ref_init (&r, lhs); return refs_may_alias_p_1 (ref, &r, true); } } |