summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 6968df6c273..aa155a8e146 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1130,7 +1130,7 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
vn_reference_op_s's. */
static void
-copy_reference_ops_from_call (gimple call,
+copy_reference_ops_from_call (gcall *call,
vec<vn_reference_op_s> *result)
{
vn_reference_op_s temp;
@@ -1456,7 +1456,7 @@ valueize_shared_reference_ops_from_ref (tree ref, bool *valueized_anything)
this function. */
static vec<vn_reference_op_s>
-valueize_shared_reference_ops_from_call (gimple call)
+valueize_shared_reference_ops_from_call (gcall *call)
{
if (!call)
return vNULL;
@@ -1630,7 +1630,8 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_,
}
if (valueized_anything)
{
- bool res = call_may_clobber_ref_p_1 (def_stmt, ref);
+ bool res = call_may_clobber_ref_p_1 (as_a <gcall *> (def_stmt),
+ ref);
for (unsigned i = 0; i < gimple_call_num_args (def_stmt); ++i)
gimple_call_set_arg (def_stmt, i, oldargs[i]);
if (!res)
@@ -2156,7 +2157,7 @@ vn_reference_lookup (tree op, tree vuse, vn_lookup_kind kind,
*VNRESULT if found. Populates *VR for the hashtable lookup. */
void
-vn_reference_lookup_call (gimple call, vn_reference_t *vnresult,
+vn_reference_lookup_call (gcall *call, vn_reference_t *vnresult,
vn_reference_t vr)
{
if (vnresult)
@@ -2859,7 +2860,7 @@ visit_nary_op (tree lhs, gimple stmt)
of the LHS has changed as a result. */
static bool
-visit_reference_op_call (tree lhs, gimple stmt)
+visit_reference_op_call (tree lhs, gcall *stmt)
{
bool changed = false;
struct vn_reference_s vr1;
@@ -3311,7 +3312,7 @@ simplify_binary_expression (gimple stmt)
simplified. */
static tree
-simplify_unary_expression (gimple stmt)
+simplify_unary_expression (gassign *stmt)
{
tree result = NULL_TREE;
tree orig_op0, op0 = gimple_assign_rhs1 (stmt);
@@ -3375,7 +3376,7 @@ simplify_unary_expression (gimple stmt)
/* Try to simplify RHS using equivalences and constant folding. */
static tree
-try_to_simplify (gimple stmt)
+try_to_simplify (gassign *stmt)
{
enum tree_code code = gimple_assign_rhs_code (stmt);
tree tem;
@@ -3463,7 +3464,7 @@ visit_use (tree use)
changed = visit_copy (lhs, rhs1);
goto done;
}
- simplified = try_to_simplify (stmt);
+ simplified = try_to_simplify (as_a <gassign *> (stmt));
if (simplified)
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -3593,7 +3594,7 @@ visit_use (tree use)
else
changed = defs_to_varying (stmt);
}
- else if (is_gimple_call (stmt))
+ else if (gcall *call_stmt = dyn_cast <gcall *> (stmt))
{
tree lhs = gimple_call_lhs (stmt);
if (lhs && TREE_CODE (lhs) == SSA_NAME)
@@ -3679,11 +3680,11 @@ visit_use (tree use)
not alias with anything else. In which case the
information that the values are distinct are encoded
in the IL. */
- && !(gimple_call_return_flags (stmt) & ERF_NOALIAS)
+ && !(gimple_call_return_flags (call_stmt) & ERF_NOALIAS)
/* Only perform the following when being called from PRE
which embeds tail merging. */
&& default_vn_walk_kind == VN_WALK)))
- changed = visit_reference_op_call (lhs, stmt);
+ changed = visit_reference_op_call (lhs, call_stmt);
else
changed = defs_to_varying (stmt);
}
@@ -3946,8 +3947,8 @@ start_over:
if (!gimple_nop_p (defstmt))
{
/* Push a new iterator. */
- if (gimple_code (defstmt) == GIMPLE_PHI)
- usep = op_iter_init_phiuse (&iter, defstmt, SSA_OP_ALL_USES);
+ if (gphi *phi = dyn_cast <gphi *> (defstmt))
+ usep = op_iter_init_phiuse (&iter, phi, SSA_OP_ALL_USES);
else
usep = op_iter_init_use (&iter, defstmt, SSA_OP_ALL_USES);
}
@@ -4269,7 +4270,7 @@ cond_dom_walker::before_dom_children (basic_block bb)
break;
}
case GIMPLE_SWITCH:
- val = gimple_switch_index (stmt);
+ val = gimple_switch_index (as_a <gswitch *> (stmt));
break;
case GIMPLE_GOTO:
val = gimple_goto_dest (stmt);