aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-08-08 14:51:26 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-08-08 14:51:26 +0000
commita471762f68f0315df2d3c772596c45f38f45fb7c (patch)
tree5689352c68b543e180bc74d7d78ab9b7cbf2ccb6
parentaa5d8db01989776315c05c52343b609d01dcc43a (diff)
downloadgcc-a471762f68f0315df2d3c772596c45f38f45fb7c.zip
gcc-a471762f68f0315df2d3c772596c45f38f45fb7c.tar.gz
gcc-a471762f68f0315df2d3c772596c45f38f45fb7c.tar.bz2
tree-ssa-operands.h (virtual_operand_p): Declare.
2012-08-08 Richard Guenther <rguenther@suse.de> * tree-ssa-operands.h (virtual_operand_p): Declare. * tree-ssa-operands.c (virtual_operand_p): New predicate. * gimple.c (is_gimple_reg): Use virtual_operand_p. * tree-into-ssa.c (prepare_block_for_update): Likewise. * tree-vect-loop-manip.c (adjust_debug_stmts): Likewise. From-SVN: r190231
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gimple.c15
-rw-r--r--gcc/tree-into-ssa.c8
-rw-r--r--gcc/tree-ssa-operands.c18
-rw-r--r--gcc/tree-ssa-operands.h1
-rw-r--r--gcc/tree-vect-loop-manip.c5
6 files changed, 37 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 18e891b..60f75a3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2012-08-08 Richard Guenther <rguenther@suse.de>
+ * tree-ssa-operands.h (virtual_operand_p): Declare.
+ * tree-ssa-operands.c (virtual_operand_p): New predicate.
+ * gimple.c (is_gimple_reg): Use virtual_operand_p.
+ * tree-into-ssa.c (prepare_block_for_update): Likewise.
+ * tree-vect-loop-manip.c (adjust_debug_stmts): Likewise.
+
+2012-08-08 Richard Guenther <rguenther@suse.de>
+
* tree-call-cdce.c (check_pow): Simplify.
(gen_conditions_for_pow_int_base): Likewise.
* tree-ssa-dom.c (propagate_rhs_into_lhs): Do not handle
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 7686f81..d78c60f 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2782,19 +2782,12 @@ is_gimple_id (tree t)
bool
is_gimple_reg (tree t)
{
- if (TREE_CODE (t) == SSA_NAME)
- {
- t = SSA_NAME_VAR (t);
- if (TREE_CODE (t) == VAR_DECL
- && VAR_DECL_IS_VIRTUAL_OPERAND (t))
- return false;
- return true;
- }
-
- if (TREE_CODE (t) == VAR_DECL
- && VAR_DECL_IS_VIRTUAL_OPERAND (t))
+ if (virtual_operand_p (t))
return false;
+ if (TREE_CODE (t) == SSA_NAME)
+ return true;
+
if (!is_gimple_variable (t))
return false;
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 74ef7f5..eb1ef6c 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -2548,14 +2548,12 @@ prepare_block_for_update (basic_block bb, bool insert_phi_p)
gimple phi = gsi_stmt (si);
tree lhs_sym, lhs = gimple_phi_result (phi);
- lhs_sym = DECL_P (lhs) ? lhs : SSA_NAME_VAR (lhs);
-
if (TREE_CODE (lhs) == SSA_NAME
- && (TREE_CODE (lhs_sym) != VAR_DECL
- || !VAR_DECL_IS_VIRTUAL_OPERAND (lhs_sym)
- || !cfun->gimple_df->rename_vops))
+ && (! virtual_operand_p (lhs)
+ || ! cfun->gimple_df->rename_vops))
continue;
+ lhs_sym = DECL_P (lhs) ? lhs : SSA_NAME_VAR (lhs);
mark_for_renaming (lhs_sym);
mark_def_interesting (lhs_sym, phi, bb, insert_phi_p);
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index cbadfd9..67e6f93 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1421,6 +1421,24 @@ debug_immediate_uses_for (tree var)
}
+/* Return true if OP, an SSA name or a DECL is a virtual operand. */
+
+bool
+virtual_operand_p (tree op)
+{
+ if (TREE_CODE (op) == SSA_NAME)
+ {
+ op = SSA_NAME_VAR (op);
+ if (!op)
+ return false;
+ }
+
+ if (TREE_CODE (op) == VAR_DECL)
+ return VAR_DECL_IS_VIRTUAL_OPERAND (op);
+
+ return false;
+}
+
/* Unlink STMTs virtual definition from the IL by propagating its use. */
void
diff --git a/gcc/tree-ssa-operands.h b/gcc/tree-ssa-operands.h
index e3fe633..2d899dd 100644
--- a/gcc/tree-ssa-operands.h
+++ b/gcc/tree-ssa-operands.h
@@ -116,6 +116,7 @@ extern void debug_decl_set (bitmap);
extern bool ssa_operands_active (void);
+extern bool virtual_operand_p (tree);
extern void unlink_stmt_vdef (gimple);
enum ssa_op_iter_type {
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index cea8a1b..5eda1f2 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -205,8 +205,9 @@ adjust_debug_stmts (tree from, tree to, basic_block bb)
{
adjust_info ai;
- if (MAY_HAVE_DEBUG_STMTS && TREE_CODE (from) == SSA_NAME
- && SSA_NAME_VAR (from) != gimple_vop (cfun))
+ if (MAY_HAVE_DEBUG_STMTS
+ && TREE_CODE (from) == SSA_NAME
+ && ! virtual_operand_p (from))
{
ai.from = from;
ai.to = to;