aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index a5e17b8..e0ac936 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -1510,11 +1510,7 @@ is_cond_scalar_reduction (gimple phi, gimple *reduc, tree arg_0, tree arg_1,
/* Make R_OP1 to hold reduction variable. */
if (r_op2 == PHI_RESULT (header_phi)
&& reduction_op == PLUS_EXPR)
- {
- tree tmp = r_op1;
- r_op1 = r_op2;
- r_op2 = tmp;
- }
+ std::swap (r_op1, r_op2);
else if (r_op1 != PHI_RESULT (header_phi))
return false;
@@ -1708,11 +1704,7 @@ predicate_scalar_phi (gphi *phi, gimple_stmt_iterator *gsi)
second_edge = EDGE_PRED (bb, 1);
cond = bb_predicate (first_edge->src);
if (TREE_CODE (cond) == TRUTH_NOT_EXPR)
- {
- edge tmp_edge = first_edge;
- first_edge = second_edge;
- second_edge = tmp_edge;
- }
+ std::swap (first_edge, second_edge);
if (EDGE_COUNT (first_edge->src->succs) > 1)
{
cond = bb_predicate (second_edge->src);
@@ -1795,11 +1787,7 @@ predicate_scalar_phi (gphi *phi, gimple_stmt_iterator *gsi)
/* Put element with max number of occurences to the end of ARGS. */
if (max_ind != -1 && max_ind +1 != (int) args_len)
- {
- tree tmp = args[args_len - 1];
- args[args_len - 1] = args[max_ind];
- args[max_ind] = tmp;
- }
+ std::swap (args[args_len - 1], args[max_ind]);
/* Handle one special case when number of arguments with different values
is equal 2 and one argument has the only occurrence. Such PHI can be
@@ -2174,11 +2162,7 @@ predicate_mem_writes (loop_p loop)
lhs = ifc_temp_var (type, unshare_expr (lhs), &gsi);
rhs = ifc_temp_var (type, unshare_expr (rhs), &gsi);
if (swap)
- {
- tree tem = lhs;
- lhs = rhs;
- rhs = tem;
- }
+ std::swap (lhs, rhs);
cond = force_gimple_operand_gsi_1 (&gsi, unshare_expr (cond),
is_gimple_condexpr, NULL_TREE,
true, GSI_SAME_STMT);