diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2004-11-27 17:26:17 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2004-11-27 17:26:17 +0000 |
commit | cdef8bc6d1ad756c5b7508168a95351270347b45 (patch) | |
tree | a81bbbb8510ca92a7b1d6e2ce2d7db16c619315c /gcc/tree.c | |
parent | 31f16dff98752d15c0f430b8e1e1daa7b682a8f0 (diff) | |
download | gcc-cdef8bc6d1ad756c5b7508168a95351270347b45.zip gcc-cdef8bc6d1ad756c5b7508168a95351270347b45.tar.gz gcc-cdef8bc6d1ad756c5b7508168a95351270347b45.tar.bz2 |
tree.c (operand_equal_for_phi_arg_p): New.
* tree.c (operand_equal_for_phi_arg_p): New.
* tree.h: Add a prototype for operand_equal_for_phi_arg_p.
* tree-cfg.c, tree-ssa-dom.c, tree-ssa-phiopt.c, tree-ssa.c:
Replace operand_equal_p with operand_for_phi_arg_p
appropriately.
From-SVN: r91385
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -6150,4 +6150,20 @@ lower_bound_in_type (tree outer, tree inner) build_int_cst_wide (inner, lo, hi)); } +/* Return nonzero if two operands that are suitable for PHI nodes are + necessarily equal. Specifically, both ARG0 and ARG1 must be either + SSA_NAME or invariant. Note that this is strictly an optimization. + That is, callers of this function can directly call operand_equal_p + and get the same result, only slower. */ + +int +operand_equal_for_phi_arg_p (tree arg0, tree arg1) +{ + if (arg0 == arg1) + return 1; + if (TREE_CODE (arg0) == SSA_NAME || TREE_CODE (arg1) == SSA_NAME) + return 0; + return operand_equal_p (arg0, arg1, 0); +} + #include "gt-tree.h" |