definition has changed. SSA edges are def-use edges in the SSA
web. For each D-U edge, we store the target statement or PHI node
U. */
-static GTY(()) VEC(tree) *interesting_ssa_edges;
+static GTY(()) VEC(tree,gc) *interesting_ssa_edges;
/* Identical to INTERESTING_SSA_EDGES. For performance reasons, the
list of SSA edges is split into two. One contains all SSA edges
don't use a separate worklist for VARYING edges, we end up with
situations where lattice values move from
UNDEFINED->INTERESTING->VARYING instead of UNDEFINED->VARYING. */
-static GTY(()) VEC(tree) *varying_ssa_edges;
+static GTY(()) VEC(tree,gc) *varying_ssa_edges;
/* Return true if the block worklist empty. */
{
STMT_IN_SSA_EDGE_WORKLIST (use_stmt) = 1;
if (is_varying)
- VEC_safe_push (tree, varying_ssa_edges, use_stmt);
+ VEC_safe_push (tree, gc, varying_ssa_edges, use_stmt);
else
- VEC_safe_push (tree, interesting_ssa_edges, use_stmt);
+ VEC_safe_push (tree, gc, interesting_ssa_edges, use_stmt);
}
}
}
SSA edge is added to it in simulate_stmt. */
static void
-process_ssa_edge_worklist (VEC(tree) **worklist)
+process_ssa_edge_worklist (VEC(tree,gc) **worklist)
{
/* Drain the entire worklist. */
while (VEC_length (tree, *worklist) > 0)
size_t i;
/* Worklists of SSA edges. */
- interesting_ssa_edges = VEC_alloc (tree, 20);
- varying_ssa_edges = VEC_alloc (tree, 20);
+ interesting_ssa_edges = VEC_alloc (tree, gc, 20);
+ varying_ssa_edges = VEC_alloc (tree, gc, 20);
executable_blocks = sbitmap_alloc (last_basic_block);
sbitmap_zero (executable_blocks);
static void
ssa_prop_fini (void)
{
- VEC_free (tree, interesting_ssa_edges);
- VEC_free (tree, varying_ssa_edges);
+ VEC_free (tree, gc, interesting_ssa_edges);
+ VEC_free (tree, gc, varying_ssa_edges);
cfg_blocks = NULL;
sbitmap_free (bb_in_list);
sbitmap_free (executable_blocks);
tree
first_vdef (tree stmt)
{
- if (NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt)) > 0)
- return V_MAY_DEF_RESULT (STMT_V_MAY_DEF_OPS (stmt), 0);
- else if (NUM_V_MUST_DEFS (STMT_V_MUST_DEF_OPS (stmt)) > 0)
- return V_MUST_DEF_RESULT (STMT_V_MUST_DEF_OPS (stmt), 0);
- else
- gcc_unreachable ();
+ ssa_op_iter iter;
+ tree op;
+
+ /* Simply return the first operand we arrive at. */
+ FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_VIRTUAL_DEFS)
+ return (op);
+
+ gcc_unreachable ();
}
if (TREE_CODE (stmt) != MODIFY_EXPR)
return false;
- if (NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt)) == 0
- && NUM_VUSES (STMT_VUSE_OPS (stmt)) == 0)
+ if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF|SSA_OP_VUSE))
return false;
rhs = TREE_OPERAND (stmt, 1);
return (!TREE_THIS_VOLATILE (rhs)
&& (DECL_P (rhs)
- || TREE_CODE_CLASS (TREE_CODE (rhs)) == tcc_reference));
+ || REFERENCE_CLASS_P (rhs)));
}
if (TREE_CODE (stmt) != MODIFY_EXPR)
return false;
- if (NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt)) == 0
- && NUM_V_MUST_DEFS (STMT_V_MUST_DEF_OPS (stmt)) == 0)
+ if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF|SSA_OP_VMUSTDEF))
return false;
lhs = TREE_OPERAND (stmt, 0);
return (!TREE_THIS_VOLATILE (lhs)
&& (DECL_P (lhs)
- || TREE_CODE_CLASS (TREE_CODE (lhs)) == tcc_reference));
+ || REFERENCE_CLASS_P (lhs)));
}
bool replaced_address, did_replace;
tree stmt = bsi_stmt (i);
- get_stmt_operands (stmt);
-
/* Replace the statement with its folded version and mark it
folded. */
if (dump_file && (dump_flags & TDF_DETAILS))