Now that create_tmp_reg_or_ssa_name just calls make_ssa_name replace
all of its uses.
Bootstrapped on x86_64-unknown-linux-gnu, built a cross to ppc64le,
pushed.
* gimple-fold.h (create_tmp_reg_or_ssa_name): Remove.
* gimple-fold.cc (create_tmp_reg_or_ssa_name): Likewise.
(gimple_fold_builtin_memory_op): Use make_ssa_name.
(gimple_fold_builtin_strchr): Likewise.
(gimple_fold_builtin_strcat): Likewise.
(gimple_load_first_char): Likewise.
(gimple_fold_builtin_string_compare): Likewise.
(gimple_build): Likewise.
* tree-inline.cc (copy_bb): Likewise.
* config/rs6000/rs6000-builtin.cc (fold_build_vec_cmp): Likewise.
(rs6000_gimple_fold_mma_builtin): Likewise.
(rs6000_gimple_fold_builtin): Likewise.
---
gcc/config/rs6000/rs6000-builtin.cc | 24 ++++++++---------
gcc/gimple-fold.cc | 42 +++++++++++------------------
gcc/gimple-fold.h | 1 -
gcc/tree-inline.cc | 2 +-
4 files changed, 28 insertions(+), 41 deletions(-)
diff --git a/gcc/config/rs6000/rs6000-builtin.cc
b/gcc/config/rs6000/rs6000-builtin.cc
index 111802381ac..bc1580f051b 100644
--- a/gcc/config/rs6000/rs6000-builtin.cc
+++ b/gcc/config/rs6000/rs6000-builtin.cc
@@ -915,7 +915,7 @@ fold_build_vec_cmp (tree_code code, tree type, tree arg0,
tree arg1,
tree cmp_type = truth_type_for (type);
tree zero_vec = build_zero_cst (type);
tree minus_one_vec = build_minus_one_cst (type);
- tree temp = create_tmp_reg_or_ssa_name (cmp_type);
+ tree temp = make_ssa_name (cmp_type);
gimple *g = gimple_build_assign (temp, code, arg0, arg1);
gsi_insert_before (gsi, g, GSI_SAME_STMT);
return fold_build3 (VEC_COND_EXPR, type, temp, minus_one_vec, zero_vec);
@@ -1106,7 +1106,7 @@ rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi,
if (TREE_TYPE (src_ptr) != src_type)
src_ptr = build1 (NOP_EXPR, src_type, src_ptr);
- tree src = create_tmp_reg_or_ssa_name (TREE_TYPE (src_type));
+ tree src = make_ssa_name (TREE_TYPE (src_type));
gimplify_assign (src, build_simple_mem_ref (src_ptr), &new_seq);
/* If we are not disassembling an accumulator/pair or our destination is
@@ -1130,7 +1130,7 @@ rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi,
{
new_decl = rs6000_builtin_decls[RS6000_BIF_XXMFACC_INTERNAL];
new_call = gimple_build_call (new_decl, 1, src);
- src = create_tmp_reg_or_ssa_name (vector_quad_type_node);
+ src = make_ssa_name (vector_quad_type_node);
gimple_call_set_lhs (new_call, src);
gimple_seq_add_stmt (&new_seq, new_call);
}
@@ -1146,7 +1146,7 @@ rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi,
unsigned index = WORDS_BIG_ENDIAN ? i : nvec - 1 - i;
tree dst = build2 (MEM_REF, unsigned_V16QI_type_node, dst_base,
build_int_cst (dst_type, index * 16));
- tree dstssa = create_tmp_reg_or_ssa_name (unsigned_V16QI_type_node);
+ tree dstssa = make_ssa_name (unsigned_V16QI_type_node);
new_call = gimple_build_call (new_decl, 2, src,
build_int_cstu (uint16_type_node, i));
gimple_call_set_lhs (new_call, dstssa);
@@ -1204,7 +1204,7 @@ rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi,
{
/* This built-in has a pass-by-reference accumulator input, so load it
into a temporary accumulator for use as a pass-by-value input. */
- op[0] = create_tmp_reg_or_ssa_name (vector_quad_type_node);
+ op[0] = make_ssa_name (vector_quad_type_node);
for (unsigned i = 1; i < nopnds; i++)
op[i] = gimple_call_arg (stmt, i);
gimplify_assign (op[0], build_simple_mem_ref (acc), &new_seq);
@@ -1252,9 +1252,9 @@ rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi,
}
if (fncode == RS6000_BIF_BUILD_PAIR || fncode == RS6000_BIF_ASSEMBLE_PAIR_V)
- lhs = create_tmp_reg_or_ssa_name (vector_pair_type_node);
+ lhs = make_ssa_name (vector_pair_type_node);
else
- lhs = create_tmp_reg_or_ssa_name (vector_quad_type_node);
+ lhs = make_ssa_name (vector_quad_type_node);
gimple_call_set_lhs (new_call, lhs);
gimple_seq_add_stmt (&new_seq, new_call);
gimplify_assign (build_simple_mem_ref (acc), lhs, &new_seq);
@@ -1450,7 +1450,7 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
arg0 = gimple_call_arg (stmt, 0);
arg1 = gimple_call_arg (stmt, 1);
lhs = gimple_call_lhs (stmt);
- temp = create_tmp_reg_or_ssa_name (TREE_TYPE (arg1));
+ temp = make_ssa_name (TREE_TYPE (arg1));
g = gimple_build_assign (temp, BIT_NOT_EXPR, arg1);
gimple_set_location (g, gimple_location (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
@@ -1472,7 +1472,7 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
arg0 = gimple_call_arg (stmt, 0);
arg1 = gimple_call_arg (stmt, 1);
lhs = gimple_call_lhs (stmt);
- temp = create_tmp_reg_or_ssa_name (TREE_TYPE (arg1));
+ temp = make_ssa_name (TREE_TYPE (arg1));
g = gimple_build_assign (temp, BIT_AND_EXPR, arg0, arg1);
gimple_set_location (g, gimple_location (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
@@ -1512,7 +1512,7 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
arg0 = gimple_call_arg (stmt, 0);
arg1 = gimple_call_arg (stmt, 1);
lhs = gimple_call_lhs (stmt);
- temp = create_tmp_reg_or_ssa_name (TREE_TYPE (arg1));
+ temp = make_ssa_name (TREE_TYPE (arg1));
g = gimple_build_assign (temp, BIT_NOT_EXPR, arg1);
gimple_set_location (g, gimple_location (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
@@ -1552,7 +1552,7 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
arg0 = gimple_call_arg (stmt, 0);
arg1 = gimple_call_arg (stmt, 1);
lhs = gimple_call_lhs (stmt);
- temp = create_tmp_reg_or_ssa_name (TREE_TYPE (arg1));
+ temp = make_ssa_name (TREE_TYPE (arg1));
g = gimple_build_assign (temp, BIT_IOR_EXPR, arg0, arg1);
gimple_set_location (g, gimple_location (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
@@ -1643,7 +1643,7 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
arg0 = gimple_call_arg (stmt, 0);
arg1 = gimple_call_arg (stmt, 1);
lhs = gimple_call_lhs (stmt);
- temp = create_tmp_reg_or_ssa_name (TREE_TYPE (arg1));
+ temp = make_ssa_name (TREE_TYPE (arg1));
g = gimple_build_assign (temp, BIT_XOR_EXPR, arg0, arg1);
gimple_set_location (g, gimple_location (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc
index 1524e825aaf..d9d05587d3a 100644
--- a/gcc/gimple-fold.cc
+++ b/gcc/gimple-fold.cc
@@ -191,16 +191,6 @@ can_refer_decl_in_current_unit_p (tree decl, tree
from_decl)
return !node || !node->inlined_to;
}
-/* Create a temporary for TYPE for a statement STMT. If the current function
- is in SSA form, a SSA name is created. Otherwise a temporary register
- is made. */
-
-tree
-create_tmp_reg_or_ssa_name (tree type, gimple *stmt)
-{
- return make_ssa_name (type, stmt);
-}
-
/* CVAL is value taken from DECL_INITIAL of variable. Try to transform it into
acceptable form for is_gimple_min_invariant.
FROM_DECL (if non-NULL) specify variable whose constructor contains CVAL.
*/
@@ -1038,8 +1028,7 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi,
{
new_stmt = gimple_build_assign (NULL_TREE, srcmem);
srcmem
- = create_tmp_reg_or_ssa_name (TREE_TYPE (srcmem),
- new_stmt);
+ = make_ssa_name (TREE_TYPE (srcmem), new_stmt);
gimple_assign_set_lhs (new_stmt, srcmem);
gimple_set_vuse (new_stmt, gimple_vuse (stmt));
gimple_set_location (new_stmt, loc);
@@ -1308,8 +1297,7 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi,
if (! is_gimple_min_invariant (srcvar))
{
new_stmt = gimple_build_assign (NULL_TREE, srcvar);
- srcvar = create_tmp_reg_or_ssa_name (TREE_TYPE (srcvar),
- new_stmt);
+ srcvar = make_ssa_name (TREE_TYPE (srcvar), new_stmt);
gimple_assign_set_lhs (new_stmt, srcvar);
gimple_set_vuse (new_stmt, gimple_vuse (stmt));
gimple_set_location (new_stmt, loc);
@@ -2281,7 +2269,7 @@ gimple_fold_builtin_strchr (gimple_stmt_iterator *gsi,
bool is_strrchr)
gimple_seq stmts = NULL;
gimple *new_stmt = gimple_build_call (strlen_fn, 1, str);
gimple_set_location (new_stmt, loc);
- len = create_tmp_reg_or_ssa_name (size_type_node);
+ len = make_ssa_name (size_type_node);
gimple_call_set_lhs (new_stmt, len);
gimple_seq_add_stmt_without_update (&stmts, new_stmt);
@@ -2427,7 +2415,7 @@ gimple_fold_builtin_strcat (gimple_stmt_iterator *gsi,
tree dst, tree src)
gimple_seq stmts = NULL, stmts2;
gimple *repl = gimple_build_call (strlen_fn, 1, dst);
gimple_set_location (repl, loc);
- newdst = create_tmp_reg_or_ssa_name (size_type_node);
+ newdst = make_ssa_name (size_type_node);
gimple_call_set_lhs (repl, newdst);
gimple_seq_add_stmt_without_update (&stmts, repl);
@@ -2660,7 +2648,7 @@ gimple_load_first_char (location_t loc, tree str,
gimple_seq *stmts)
tree temp = fold_build2_loc (loc, MEM_REF, cst_uchar_node, str, off0);
gassign *stmt = gimple_build_assign (NULL_TREE, temp);
- var = create_tmp_reg_or_ssa_name (cst_uchar_node, stmt);
+ var = make_ssa_name (cst_uchar_node, stmt);
gimple_assign_set_lhs (stmt, var);
gimple_seq_add_stmt_without_update (stmts, stmt);
@@ -2831,7 +2819,7 @@ gimple_fold_builtin_string_compare (gimple_stmt_iterator
*gsi)
if (lhs)
{
- tree c = create_tmp_reg_or_ssa_name (integer_type_node);
+ tree c = make_ssa_name (integer_type_node);
stmt = gimple_build_assign (c, NOP_EXPR, var);
gimple_seq_add_stmt_without_update (&stmts, stmt);
@@ -2853,11 +2841,11 @@ gimple_fold_builtin_string_compare
(gimple_stmt_iterator *gsi)
if (lhs)
{
- tree c1 = create_tmp_reg_or_ssa_name (integer_type_node);
+ tree c1 = make_ssa_name (integer_type_node);
gassign *convert1 = gimple_build_assign (c1, NOP_EXPR, temp1);
gimple_seq_add_stmt_without_update (&stmts, convert1);
- tree c2 = create_tmp_reg_or_ssa_name (integer_type_node);
+ tree c2 = make_ssa_name (integer_type_node);
gassign *convert2 = gimple_build_assign (c2, NOP_EXPR, temp2);
gimple_seq_add_stmt_without_update (&stmts, convert2);
@@ -10647,7 +10635,7 @@ gimple_build (gimple_stmt_iterator *gsi,
gsi->bb ? follow_all_ssa_edges : gimple_build_valueize);
if (!res)
{
- res = create_tmp_reg_or_ssa_name (type);
+ res = make_ssa_name (type);
gimple *stmt;
if (code == REALPART_EXPR
|| code == IMAGPART_EXPR
@@ -10679,7 +10667,7 @@ gimple_build (gimple_stmt_iterator *gsi,
gsi->bb ? follow_all_ssa_edges : gimple_build_valueize);
if (!res)
{
- res = create_tmp_reg_or_ssa_name (type);
+ res = make_ssa_name (type);
gimple *stmt = gimple_build_assign (res, code, op0, op1);
gimple_set_location (stmt, loc);
gimple_seq_add_stmt_without_update (&seq, stmt);
@@ -10706,7 +10694,7 @@ gimple_build (gimple_stmt_iterator *gsi,
gsi->bb ? follow_all_ssa_edges : gimple_build_valueize);
if (!res)
{
- res = create_tmp_reg_or_ssa_name (type);
+ res = make_ssa_name (type);
gimple *stmt;
if (code == BIT_FIELD_REF)
stmt = gimple_build_assign (res, code,
@@ -10742,7 +10730,7 @@ gimple_build (gimple_stmt_iterator *gsi,
}
if (!VOID_TYPE_P (type))
{
- res = create_tmp_reg_or_ssa_name (type);
+ res = make_ssa_name (type);
gimple_call_set_lhs (stmt, res);
}
gimple_set_location (stmt, loc);
@@ -10777,7 +10765,7 @@ gimple_build (gimple_stmt_iterator *gsi,
}
if (!VOID_TYPE_P (type))
{
- res = create_tmp_reg_or_ssa_name (type);
+ res = make_ssa_name (type);
gimple_call_set_lhs (stmt, res);
}
gimple_set_location (stmt, loc);
@@ -10814,7 +10802,7 @@ gimple_build (gimple_stmt_iterator *gsi,
}
if (!VOID_TYPE_P (type))
{
- res = create_tmp_reg_or_ssa_name (type);
+ res = make_ssa_name (type);
gimple_call_set_lhs (stmt, res);
}
gimple_set_location (stmt, loc);
@@ -10852,7 +10840,7 @@ gimple_build (gimple_stmt_iterator *gsi,
}
if (!VOID_TYPE_P (type))
{
- res = create_tmp_reg_or_ssa_name (type);
+ res = make_ssa_name (type);
gimple_call_set_lhs (stmt, res);
}
gimple_set_location (stmt, loc);
diff --git a/gcc/gimple-fold.h b/gcc/gimple-fold.h
index 8a52b0c1d32..b678502f2fc 100644
--- a/gcc/gimple-fold.h
+++ b/gcc/gimple-fold.h
@@ -22,7 +22,6 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_GIMPLE_FOLD_H
#define GCC_GIMPLE_FOLD_H
-extern tree create_tmp_reg_or_ssa_name (tree, gimple *stmt = NULL);
extern tree canonicalize_constructor_val (tree, tree);
extern tree get_symbol_constant_value (tree);
struct c_strlen_data;
diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc
index 1a72e31b06c..fa8f8fc11f0 100644
--- a/gcc/tree-inline.cc
+++ b/gcc/tree-inline.cc
@@ -2239,7 +2239,7 @@ copy_bb (copy_body_data *id, basic_block bb,
}
else if (nargs != 0)
{
- tree newlhs = create_tmp_reg_or_ssa_name (integer_type_node);
+ tree newlhs = make_ssa_name (integer_type_node);
count = build_int_cst (integer_type_node, nargs);
new_stmt = gimple_build_assign (gimple_call_lhs (stmt),
PLUS_EXPR, newlhs, count);
--
2.43.0