+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.
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;
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);
}
+/* 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
extern bool ssa_operands_active (void);
+extern bool virtual_operand_p (tree);
extern void unlink_stmt_vdef (gimple);
enum ssa_op_iter_type {
{
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;