]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-operands.h (virtual_operand_p): Declare.
authorRichard Guenther <rguenther@suse.de>
Wed, 8 Aug 2012 14:51:26 +0000 (14:51 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 8 Aug 2012 14:51:26 +0000 (14:51 +0000)
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

gcc/ChangeLog
gcc/gimple.c
gcc/tree-into-ssa.c
gcc/tree-ssa-operands.c
gcc/tree-ssa-operands.h
gcc/tree-vect-loop-manip.c

index 18e891b6dc53ba442750655c085369f8097142e0..60f75a3d8443443020e436857eb1f93300561ee6 100644 (file)
@@ -1,3 +1,11 @@
+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.
index 7686f8105cd5025cc00e2d702977e66bb6185f1c..d78c60f22e84e1e309c94c3edc8ca1c6ae0f313a 100644 (file)
@@ -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;
 
index 74ef7f5b61d5da42e165c41f5e0f5d6e4cd64494..eb1ef6c1c9a76cab11c4c0dbca6d5e5bd49fc4c0 100644 (file)
@@ -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);
 
index cbadfd9ae809b2dba390209ce4b9c2c7ddbf66df..67e6f935972bf06d577b8c2d1e356e59fcbf75d7 100644 (file)
@@ -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
index e3fe63364a5636ee517c48ed502cb63c74bfae09..2d899dda45baeb8ea206c90052f29df5343b5a28 100644 (file)
@@ -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 {
index cea8a1b8c524a9455e984a8cf6053fce2a625ee7..5eda1f2ee10e3ec3c416f1bf6eea1ed7d3a2755c 100644 (file)
@@ -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;