aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-07-16 12:02:25 +0200
committerRichard Biener <rguenther@suse.de>2021-07-16 12:52:17 +0200
commitce777eaedfdc55850b429f97b2093f2de5da09de (patch)
tree56ea1a168ac8a25522d06c78c4237b85dc1d3864 /gcc/tree-ssa-sccvn.c
parent0990d93dd8a4268bff5bbe48aa26748cf63201c7 (diff)
downloadgcc-ce777eaedfdc55850b429f97b2093f2de5da09de.zip
gcc-ce777eaedfdc55850b429f97b2093f2de5da09de.tar.gz
gcc-ce777eaedfdc55850b429f97b2093f2de5da09de.tar.bz2
Get rid of some gimple_expr_type uses
This gets rid of a few gimple_expr_type uses. 2021-07-16 Richard Biener <rguenther@suse.de> * gimple-fold.c (gimple_fold_stmt_to_constant_1): Use the type of the LHS. (gimple_assign_nonnegative_warnv_p): Likewise. (gimple_call_nonnegative_warnv_p): Likewise. Return false if the call has no LHS. * gimple.c (gimple_could_trap_p_1): Use the type of the LHS. * tree-eh.c (stmt_could_throw_1_p): Likewise. * tree-inline.c (insert_init_stmt): Likewise. * tree-ssa-loop-niter.c (get_val_for): Likewise. * tree-outof-ssa.c (ssa_is_replaceable_p): Use the type of the def. * tree-ssa-sccvn.c (init_vn_nary_op_from_stmt): Take a gassign *. Use the type of the lhs. (vn_nary_op_lookup_stmt): Adjust. (vn_nary_op_insert_stmt): Likewise.
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index d6aee2e..7900df9 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -423,7 +423,7 @@ static unsigned int vn_nary_length_from_stmt (gimple *);
static vn_nary_op_t alloc_vn_nary_op_noinit (unsigned int, obstack *);
static vn_nary_op_t vn_nary_op_insert_into (vn_nary_op_t,
vn_nary_op_table_type *, bool);
-static void init_vn_nary_op_from_stmt (vn_nary_op_t, gimple *);
+static void init_vn_nary_op_from_stmt (vn_nary_op_t, gassign *);
static void init_vn_nary_op_from_pieces (vn_nary_op_t, unsigned int,
enum tree_code, tree, tree *);
static tree vn_lookup_simplify_result (gimple_match_op *);
@@ -2377,7 +2377,7 @@ vn_nary_build_or_lookup_1 (gimple_match_op *res_op, bool insert)
vno1->length = length;
vno1->predicated_values = 0;
vno1->u.result = result;
- init_vn_nary_op_from_stmt (vno1, new_stmt);
+ init_vn_nary_op_from_stmt (vno1, as_a <gassign *> (new_stmt));
vn_nary_op_insert_into (vno1, valid_info->nary, true);
/* Also do not link it into the undo chain. */
last_inserted_nary = vno1->next;
@@ -3882,12 +3882,12 @@ vn_nary_length_from_stmt (gimple *stmt)
/* Initialize VNO from STMT. */
static void
-init_vn_nary_op_from_stmt (vn_nary_op_t vno, gimple *stmt)
+init_vn_nary_op_from_stmt (vn_nary_op_t vno, gassign *stmt)
{
unsigned i;
vno->opcode = gimple_assign_rhs_code (stmt);
- vno->type = gimple_expr_type (stmt);
+ vno->type = TREE_TYPE (gimple_assign_lhs (stmt));
switch (vno->opcode)
{
case REALPART_EXPR:
@@ -3968,7 +3968,7 @@ vn_nary_op_lookup_stmt (gimple *stmt, vn_nary_op_t *vnresult)
vn_nary_op_t vno1
= XALLOCAVAR (struct vn_nary_op_s,
sizeof_vn_nary_op (vn_nary_length_from_stmt (stmt)));
- init_vn_nary_op_from_stmt (vno1, stmt);
+ init_vn_nary_op_from_stmt (vno1, as_a <gassign *> (stmt));
return vn_nary_op_lookup_1 (vno1, vnresult);
}
@@ -4221,7 +4221,7 @@ vn_nary_op_insert_stmt (gimple *stmt, tree result)
vn_nary_op_t vno1
= alloc_vn_nary_op (vn_nary_length_from_stmt (stmt),
result, VN_INFO (result)->value_id);
- init_vn_nary_op_from_stmt (vno1, stmt);
+ init_vn_nary_op_from_stmt (vno1, as_a <gassign *> (stmt));
return vn_nary_op_insert_into (vno1, valid_info->nary, true);
}