Use std::swap instead of explicit swaps
gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
This commit is contained in:
parent
de7fe08778
commit
fab27f5289
|
@ -1,3 +1,52 @@
|
||||||
|
2015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
|
||||||
|
|
||||||
|
* bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of
|
||||||
|
explicit swaps.
|
||||||
|
* dojump.c (do_compare_rtx_and_jump): Likewise.
|
||||||
|
* expmed.c (emit_store_flag_1): Likewise.
|
||||||
|
* fibonacci_heap.h (fibonacci_heap::union_with): Likewise.
|
||||||
|
* final.c (sprint_ul): Use std::reverse for reversing a string.
|
||||||
|
* fold-const.c (extract_muldiv_1): Use std::swap.
|
||||||
|
* genmodes.c (emit_mode_int_n): Likewise.
|
||||||
|
* ifcvt.c (dead_or_predicable): Likewise.
|
||||||
|
* ira-build.c (ira_merge_live_ranges): Likewise.
|
||||||
|
(swap_allocno_copy_ends_if_necessary): Likewise.
|
||||||
|
* ira.c (ira_setup_alts): Likewise.
|
||||||
|
* loop-iv.c (iv_analyze_expr): Likewise.
|
||||||
|
(implies_p): Likewise.
|
||||||
|
(canon_condition): Likewise.
|
||||||
|
* lra-constraints.c (swap_operands): Likewise.
|
||||||
|
* lra-lives.c (lra_merge_live_ranges): Likewise.
|
||||||
|
* omega.c (swap): Remove.
|
||||||
|
(bswap): Remove.
|
||||||
|
(omega_unprotect_1): Use std::swap.
|
||||||
|
(omega_solve_geq): Likewise.
|
||||||
|
* optabs.c (expand_binop_directly): Likewise.
|
||||||
|
(expand_binop): Likewise.
|
||||||
|
(emit_conditional_move): Likewise.
|
||||||
|
(emit_conditional_add): Likewise.
|
||||||
|
* postreload.c (reload_cse_simplify_operands): Likewise.
|
||||||
|
* reg-stack.c (emit_swap_insn): Likewise.
|
||||||
|
(swap_to_top): Likewise.
|
||||||
|
(compare_for_stack_reg): Likewise.
|
||||||
|
(subst_asm_stack_regs): Likewise.
|
||||||
|
* reload.c (find_reloads): Likewise.
|
||||||
|
* reload1.c (gen_reload_chain_without_interm_reg_p): Likewise.
|
||||||
|
* sel-sched.c (invoke_reorder_hooks): Likewise.
|
||||||
|
(create_block_for_bookkeeping): Likewise.
|
||||||
|
* tree-data-ref.c (lambda_matrix_row_exchange): Remove.
|
||||||
|
(lambda_matrix_right_hermite): Use std::swap.
|
||||||
|
* tree-ssa-coalesce.c (sort_coalesce_list): Likewise.
|
||||||
|
* tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise.
|
||||||
|
* tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise.
|
||||||
|
* tree-ssa-math-opts.c (is_widening_mult_p): Likewise.
|
||||||
|
* tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
|
||||||
|
* tree-ssa-reassoc.c (linearize_expr_tree): Likewise.
|
||||||
|
* tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
|
||||||
|
* tree-vrp.c (compare_ranges): Likewise.
|
||||||
|
* var-tracking.c (add_with_sets): Likewise.
|
||||||
|
(vt_find_locations): Likewise.
|
||||||
|
|
||||||
2015-05-18 Andreas Tobler <andreast@gcc.gnu.org>
|
2015-05-18 Andreas Tobler <andreast@gcc.gnu.org>
|
||||||
|
|
||||||
* config/freebsd-spec.h (FBSD_STARTFILE_SPEC): Add the bits to build
|
* config/freebsd-spec.h (FBSD_STARTFILE_SPEC): Add the bits to build
|
||||||
|
|
|
@ -1812,7 +1812,6 @@ fix_up_fall_thru_edges (void)
|
||||||
edge succ2;
|
edge succ2;
|
||||||
edge fall_thru;
|
edge fall_thru;
|
||||||
edge cond_jump = NULL;
|
edge cond_jump = NULL;
|
||||||
edge e;
|
|
||||||
bool cond_jump_crosses;
|
bool cond_jump_crosses;
|
||||||
int invert_worked;
|
int invert_worked;
|
||||||
rtx_insn *old_jump;
|
rtx_insn *old_jump;
|
||||||
|
@ -1901,9 +1900,7 @@ fix_up_fall_thru_edges (void)
|
||||||
fall_thru->flags &= ~EDGE_FALLTHRU;
|
fall_thru->flags &= ~EDGE_FALLTHRU;
|
||||||
cond_jump->flags |= EDGE_FALLTHRU;
|
cond_jump->flags |= EDGE_FALLTHRU;
|
||||||
update_br_prob_note (cur_bb);
|
update_br_prob_note (cur_bb);
|
||||||
e = fall_thru;
|
std::swap (fall_thru, cond_jump);
|
||||||
fall_thru = cond_jump;
|
|
||||||
cond_jump = e;
|
|
||||||
cond_jump->flags |= EDGE_CROSSING;
|
cond_jump->flags |= EDGE_CROSSING;
|
||||||
fall_thru->flags &= ~EDGE_CROSSING;
|
fall_thru->flags &= ~EDGE_CROSSING;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
|
||||||
|
|
||||||
|
* c-common.c (shorten_compare): Use std::swap instead of explicit swaps.
|
||||||
|
|
||||||
2015-05-18 Tom de Vries <tom@codesourcery.com>
|
2015-05-18 Tom de Vries <tom@codesourcery.com>
|
||||||
|
|
||||||
* c-common.c (build_va_arg_1): New function.
|
* c-common.c (build_va_arg_1): New function.
|
||||||
|
|
|
@ -4372,20 +4372,12 @@ shorten_compare (location_t loc, tree *op0_ptr, tree *op1_ptr,
|
||||||
&& !integer_zerop (primop1) && !real_zerop (primop1)
|
&& !integer_zerop (primop1) && !real_zerop (primop1)
|
||||||
&& !fixed_zerop (primop1))
|
&& !fixed_zerop (primop1))
|
||||||
{
|
{
|
||||||
tree tem = primop0;
|
std::swap (primop0, primop1);
|
||||||
int temi = unsignedp0;
|
std::swap (op0, op1);
|
||||||
primop0 = primop1;
|
|
||||||
primop1 = tem;
|
|
||||||
tem = op0;
|
|
||||||
op0 = op1;
|
|
||||||
op1 = tem;
|
|
||||||
*op0_ptr = op0;
|
*op0_ptr = op0;
|
||||||
*op1_ptr = op1;
|
*op1_ptr = op1;
|
||||||
unsignedp0 = unsignedp1;
|
std::swap (unsignedp0, unsignedp1);
|
||||||
unsignedp1 = temi;
|
std::swap (real1, real2);
|
||||||
temi = real1;
|
|
||||||
real1 = real2;
|
|
||||||
real2 = temi;
|
|
||||||
|
|
||||||
switch (code)
|
switch (code)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
|
||||||
|
|
||||||
|
* c-typeck.c (build_array_ref): Use std::swap instead of explicit
|
||||||
|
swaps
|
||||||
|
|
||||||
2015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
2015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
||||||
|
|
||||||
PR fortran/44054
|
PR fortran/44054
|
||||||
|
|
|
@ -2474,7 +2474,6 @@ build_array_ref (location_t loc, tree array, tree index)
|
||||||
/* Allow vector[index] but not index[vector]. */
|
/* Allow vector[index] but not index[vector]. */
|
||||||
&& TREE_CODE (TREE_TYPE (array)) != VECTOR_TYPE)
|
&& TREE_CODE (TREE_TYPE (array)) != VECTOR_TYPE)
|
||||||
{
|
{
|
||||||
tree temp;
|
|
||||||
if (TREE_CODE (TREE_TYPE (index)) != ARRAY_TYPE
|
if (TREE_CODE (TREE_TYPE (index)) != ARRAY_TYPE
|
||||||
&& TREE_CODE (TREE_TYPE (index)) != POINTER_TYPE)
|
&& TREE_CODE (TREE_TYPE (index)) != POINTER_TYPE)
|
||||||
{
|
{
|
||||||
|
@ -2483,9 +2482,7 @@ build_array_ref (location_t loc, tree array, tree index)
|
||||||
|
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
}
|
}
|
||||||
temp = array;
|
std::swap (array, index);
|
||||||
array = index;
|
|
||||||
index = temp;
|
|
||||||
swapped = true;
|
swapped = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
|
||||||
|
|
||||||
|
* typeck.c (composite_pointer_type): Use std::swap instead of explicit
|
||||||
|
swaps.
|
||||||
|
|
||||||
2015-05-18 Jason Merrill <jason@redhat.com>
|
2015-05-18 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
* pt.c (retrieve_specialization): Make sure our arguments have
|
* pt.c (retrieve_specialization): Make sure our arguments have
|
||||||
|
|
|
@ -606,12 +606,7 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
|
||||||
|
|
||||||
If either type is a pointer to void, make sure it is T1. */
|
If either type is a pointer to void, make sure it is T1. */
|
||||||
if (TYPE_PTR_P (t2) && VOID_TYPE_P (TREE_TYPE (t2)))
|
if (TYPE_PTR_P (t2) && VOID_TYPE_P (TREE_TYPE (t2)))
|
||||||
{
|
std::swap (t1, t2);
|
||||||
tree t;
|
|
||||||
t = t1;
|
|
||||||
t1 = t2;
|
|
||||||
t2 = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now, if T1 is a pointer to void, merge the qualifiers. */
|
/* Now, if T1 is a pointer to void, merge the qualifiers. */
|
||||||
if (TYPE_PTR_P (t1) && VOID_TYPE_P (TREE_TYPE (t1)))
|
if (TYPE_PTR_P (t1) && VOID_TYPE_P (TREE_TYPE (t1)))
|
||||||
|
|
|
@ -1096,11 +1096,8 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp,
|
||||||
&& ! can_compare_p (code, mode, ccp_jump)
|
&& ! can_compare_p (code, mode, ccp_jump)
|
||||||
&& can_compare_p (swap_condition (code), mode, ccp_jump))
|
&& can_compare_p (swap_condition (code), mode, ccp_jump))
|
||||||
{
|
{
|
||||||
rtx tmp;
|
|
||||||
code = swap_condition (code);
|
code = swap_condition (code);
|
||||||
tmp = op0;
|
std::swap (op0, op1);
|
||||||
op0 = op1;
|
|
||||||
op1 = tmp;
|
|
||||||
}
|
}
|
||||||
else if (SCALAR_FLOAT_MODE_P (mode)
|
else if (SCALAR_FLOAT_MODE_P (mode)
|
||||||
&& ! can_compare_p (code, mode, ccp_jump)
|
&& ! can_compare_p (code, mode, ccp_jump)
|
||||||
|
|
10
gcc/expmed.c
10
gcc/expmed.c
|
@ -5256,7 +5256,6 @@ emit_store_flag_1 (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
||||||
machine_mode compare_mode;
|
machine_mode compare_mode;
|
||||||
enum mode_class mclass;
|
enum mode_class mclass;
|
||||||
enum rtx_code scode;
|
enum rtx_code scode;
|
||||||
rtx tem;
|
|
||||||
|
|
||||||
if (unsignedp)
|
if (unsignedp)
|
||||||
code = unsigned_condition (code);
|
code = unsigned_condition (code);
|
||||||
|
@ -5267,9 +5266,7 @@ emit_store_flag_1 (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
||||||
|
|
||||||
if (swap_commutative_operands_p (op0, op1))
|
if (swap_commutative_operands_p (op0, op1))
|
||||||
{
|
{
|
||||||
tem = op0;
|
std::swap (op0, op1);
|
||||||
op0 = op1;
|
|
||||||
op1 = tem;
|
|
||||||
code = swap_condition (code);
|
code = swap_condition (code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5316,6 +5313,7 @@ emit_store_flag_1 (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
||||||
&& GET_MODE_CLASS (mode) == MODE_INT
|
&& GET_MODE_CLASS (mode) == MODE_INT
|
||||||
&& (!MEM_P (op0) || ! MEM_VOLATILE_P (op0)))
|
&& (!MEM_P (op0) || ! MEM_VOLATILE_P (op0)))
|
||||||
{
|
{
|
||||||
|
rtx tem;
|
||||||
if ((code == EQ || code == NE)
|
if ((code == EQ || code == NE)
|
||||||
&& (op1 == const0_rtx || op1 == constm1_rtx))
|
&& (op1 == const0_rtx || op1 == constm1_rtx))
|
||||||
{
|
{
|
||||||
|
@ -5415,8 +5413,8 @@ emit_store_flag_1 (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
||||||
if (icode != CODE_FOR_nothing)
|
if (icode != CODE_FOR_nothing)
|
||||||
{
|
{
|
||||||
do_pending_stack_adjust ();
|
do_pending_stack_adjust ();
|
||||||
tem = emit_cstore (target, icode, code, mode, compare_mode,
|
rtx tem = emit_cstore (target, icode, code, mode, compare_mode,
|
||||||
unsignedp, op0, op1, normalizep, target_mode);
|
unsignedp, op0, op1, normalizep, target_mode);
|
||||||
if (tem)
|
if (tem)
|
||||||
return tem;
|
return tem;
|
||||||
|
|
||||||
|
|
|
@ -457,7 +457,7 @@ fibonacci_heap<K,V>::union_with (fibonacci_heap<K,V> *heapb)
|
||||||
{
|
{
|
||||||
fibonacci_heap<K,V> *heapa = this;
|
fibonacci_heap<K,V> *heapa = this;
|
||||||
|
|
||||||
fibonacci_node<K,V> *a_root, *b_root, *temp;
|
fibonacci_node<K,V> *a_root, *b_root;
|
||||||
|
|
||||||
/* If one of the heaps is empty, the union is just the other heap. */
|
/* If one of the heaps is empty, the union is just the other heap. */
|
||||||
if ((a_root = heapa->m_root) == NULL)
|
if ((a_root = heapa->m_root) == NULL)
|
||||||
|
@ -474,9 +474,7 @@ fibonacci_heap<K,V>::union_with (fibonacci_heap<K,V> *heapb)
|
||||||
/* Merge them to the next nodes on the opposite chain. */
|
/* Merge them to the next nodes on the opposite chain. */
|
||||||
a_root->m_left->m_right = b_root;
|
a_root->m_left->m_right = b_root;
|
||||||
b_root->m_left->m_right = a_root;
|
b_root->m_left->m_right = a_root;
|
||||||
temp = a_root->m_left;
|
std::swap (a_root->m_left, b_root->m_left);
|
||||||
a_root->m_left = b_root->m_left;
|
|
||||||
b_root->m_left = temp;
|
|
||||||
heapa->m_nodes += heapb->m_nodes;
|
heapa->m_nodes += heapb->m_nodes;
|
||||||
|
|
||||||
/* And set the new minimum, if it's changed. */
|
/* And set the new minimum, if it's changed. */
|
||||||
|
|
19
gcc/final.c
19
gcc/final.c
|
@ -4131,25 +4131,10 @@ fprint_ul (FILE *f, unsigned long value)
|
||||||
int
|
int
|
||||||
sprint_ul (char *s, unsigned long value)
|
sprint_ul (char *s, unsigned long value)
|
||||||
{
|
{
|
||||||
int len;
|
int len = sprint_ul_rev (s, value);
|
||||||
char tmp_c;
|
|
||||||
int i;
|
|
||||||
int j;
|
|
||||||
|
|
||||||
len = sprint_ul_rev (s, value);
|
|
||||||
s[len] = '\0';
|
s[len] = '\0';
|
||||||
|
|
||||||
/* Reverse the string. */
|
std::reverse (s, s + len);
|
||||||
i = 0;
|
|
||||||
j = len - 1;
|
|
||||||
while (i < j)
|
|
||||||
{
|
|
||||||
tmp_c = s[i];
|
|
||||||
s[i] = s[j];
|
|
||||||
s[j] = tmp_c;
|
|
||||||
i++; j--;
|
|
||||||
}
|
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6139,12 +6139,8 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type,
|
||||||
/* If OP1 was not easily negatable, the constant may be OP0. */
|
/* If OP1 was not easily negatable, the constant may be OP0. */
|
||||||
if (TREE_CODE (op0) == INTEGER_CST)
|
if (TREE_CODE (op0) == INTEGER_CST)
|
||||||
{
|
{
|
||||||
tree tem = op0;
|
std::swap (op0, op1);
|
||||||
op0 = op1;
|
std::swap (t1, t2);
|
||||||
op1 = tem;
|
|
||||||
tem = t1;
|
|
||||||
t1 = t2;
|
|
||||||
t2 = tem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
2015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
|
||||||
|
|
||||||
|
* interface.c (compare_actual_formal): Use std::swap instead of
|
||||||
|
explicit swaps.
|
||||||
|
* trans-array.c (gfc_trans_scalarized_loop_end): Likewise.
|
||||||
|
* trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise.
|
||||||
|
|
||||||
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
|
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||||
|
|
||||||
PR fortran/66106
|
PR fortran/66106
|
||||||
|
|
|
@ -2566,7 +2566,7 @@ static int
|
||||||
compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
|
compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
|
||||||
int ranks_must_agree, int is_elemental, locus *where)
|
int ranks_must_agree, int is_elemental, locus *where)
|
||||||
{
|
{
|
||||||
gfc_actual_arglist **new_arg, *a, *actual, temp;
|
gfc_actual_arglist **new_arg, *a, *actual;
|
||||||
gfc_formal_arglist *f;
|
gfc_formal_arglist *f;
|
||||||
int i, n, na;
|
int i, n, na;
|
||||||
unsigned long actual_size, formal_size;
|
unsigned long actual_size, formal_size;
|
||||||
|
@ -3029,13 +3029,8 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
|
||||||
|
|
||||||
if (na != 0)
|
if (na != 0)
|
||||||
{
|
{
|
||||||
temp = *new_arg[0];
|
std::swap (*new_arg[0], *actual);
|
||||||
*new_arg[0] = *actual;
|
std::swap (new_arg[0], new_arg[na]);
|
||||||
*actual = temp;
|
|
||||||
|
|
||||||
a = new_arg[0];
|
|
||||||
new_arg[0] = new_arg[na];
|
|
||||||
new_arg[na] = a;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < n - 1; i++)
|
for (i = 0; i < n - 1; i++)
|
||||||
|
|
|
@ -3644,11 +3644,7 @@ gfc_trans_scalarized_loop_end (gfc_loopinfo * loop, int n,
|
||||||
loopbody = gfc_finish_block (pbody);
|
loopbody = gfc_finish_block (pbody);
|
||||||
|
|
||||||
if (reverse_loop)
|
if (reverse_loop)
|
||||||
{
|
std::swap (loop->from[n], loop->to[n]);
|
||||||
tmp = loop->from[n];
|
|
||||||
loop->from[n] = loop->to[n];
|
|
||||||
loop->to[n] = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialize the loopvar. */
|
/* Initialize the loopvar. */
|
||||||
if (loop->loopvar[n] != loop->from[n])
|
if (loop->loopvar[n] != loop->from[n])
|
||||||
|
|
|
@ -8324,14 +8324,10 @@ walk_inline_intrinsic_transpose (gfc_ss *ss, gfc_expr *expr)
|
||||||
if (tmp_ss->info->type != GFC_SS_SCALAR
|
if (tmp_ss->info->type != GFC_SS_SCALAR
|
||||||
&& tmp_ss->info->type != GFC_SS_REFERENCE)
|
&& tmp_ss->info->type != GFC_SS_REFERENCE)
|
||||||
{
|
{
|
||||||
int tmp_dim;
|
|
||||||
|
|
||||||
gcc_assert (tmp_ss->dimen == 2);
|
gcc_assert (tmp_ss->dimen == 2);
|
||||||
|
|
||||||
/* We just invert dimensions. */
|
/* We just invert dimensions. */
|
||||||
tmp_dim = tmp_ss->dim[0];
|
std::swap (tmp_ss->dim[0], tmp_ss->dim[1]);
|
||||||
tmp_ss->dim[0] = tmp_ss->dim[1];
|
|
||||||
tmp_ss->dim[1] = tmp_dim;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stop when tmp_ss points to the last valid element of the chain... */
|
/* Stop when tmp_ss points to the last valid element of the chain... */
|
||||||
|
|
|
@ -1600,11 +1600,7 @@ emit_mode_int_n (void)
|
||||||
for (i = 0; i<n_modes - 1; i++)
|
for (i = 0; i<n_modes - 1; i++)
|
||||||
for (j = i + 1; j < n_modes; j++)
|
for (j = i + 1; j < n_modes; j++)
|
||||||
if (mode_sort[i]->int_n > mode_sort[j]->int_n)
|
if (mode_sort[i]->int_n > mode_sort[j]->int_n)
|
||||||
{
|
std::swap (mode_sort[i], mode_sort[j]);
|
||||||
m = mode_sort[i];
|
|
||||||
mode_sort[i] = mode_sort[j];
|
|
||||||
mode_sort[j] = m;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < n_modes; i ++)
|
for (i = 0; i < n_modes; i ++)
|
||||||
{
|
{
|
||||||
|
|
12
gcc/ifcvt.c
12
gcc/ifcvt.c
|
@ -4462,14 +4462,10 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
|
||||||
redirect_edge_succ (BRANCH_EDGE (test_bb), new_dest);
|
redirect_edge_succ (BRANCH_EDGE (test_bb), new_dest);
|
||||||
if (reversep)
|
if (reversep)
|
||||||
{
|
{
|
||||||
gcov_type count, probability;
|
std::swap (BRANCH_EDGE (test_bb)->count,
|
||||||
count = BRANCH_EDGE (test_bb)->count;
|
FALLTHRU_EDGE (test_bb)->count);
|
||||||
BRANCH_EDGE (test_bb)->count = FALLTHRU_EDGE (test_bb)->count;
|
std::swap (BRANCH_EDGE (test_bb)->probability,
|
||||||
FALLTHRU_EDGE (test_bb)->count = count;
|
FALLTHRU_EDGE (test_bb)->probability);
|
||||||
probability = BRANCH_EDGE (test_bb)->probability;
|
|
||||||
BRANCH_EDGE (test_bb)->probability
|
|
||||||
= FALLTHRU_EDGE (test_bb)->probability;
|
|
||||||
FALLTHRU_EDGE (test_bb)->probability = probability;
|
|
||||||
update_br_prob_note (test_bb);
|
update_br_prob_note (test_bb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1000,7 +1000,7 @@ ira_copy_live_range_list (live_range_t r)
|
||||||
live_range_t
|
live_range_t
|
||||||
ira_merge_live_ranges (live_range_t r1, live_range_t r2)
|
ira_merge_live_ranges (live_range_t r1, live_range_t r2)
|
||||||
{
|
{
|
||||||
live_range_t first, last, temp;
|
live_range_t first, last;
|
||||||
|
|
||||||
if (r1 == NULL)
|
if (r1 == NULL)
|
||||||
return r2;
|
return r2;
|
||||||
|
@ -1009,18 +1009,14 @@ ira_merge_live_ranges (live_range_t r1, live_range_t r2)
|
||||||
for (first = last = NULL; r1 != NULL && r2 != NULL;)
|
for (first = last = NULL; r1 != NULL && r2 != NULL;)
|
||||||
{
|
{
|
||||||
if (r1->start < r2->start)
|
if (r1->start < r2->start)
|
||||||
{
|
std::swap (r1, r2);
|
||||||
temp = r1;
|
|
||||||
r1 = r2;
|
|
||||||
r2 = temp;
|
|
||||||
}
|
|
||||||
if (r1->start <= r2->finish + 1)
|
if (r1->start <= r2->finish + 1)
|
||||||
{
|
{
|
||||||
/* Intersected ranges: merge r1 and r2 into r1. */
|
/* Intersected ranges: merge r1 and r2 into r1. */
|
||||||
r1->start = r2->start;
|
r1->start = r2->start;
|
||||||
if (r1->finish < r2->finish)
|
if (r1->finish < r2->finish)
|
||||||
r1->finish = r2->finish;
|
r1->finish = r2->finish;
|
||||||
temp = r2;
|
live_range_t temp = r2;
|
||||||
r2 = r2->next;
|
r2 = r2->next;
|
||||||
ira_finish_live_range (temp);
|
ira_finish_live_range (temp);
|
||||||
if (r2 == NULL)
|
if (r2 == NULL)
|
||||||
|
@ -1479,23 +1475,12 @@ add_allocno_copy_to_list (ira_copy_t cp)
|
||||||
static void
|
static void
|
||||||
swap_allocno_copy_ends_if_necessary (ira_copy_t cp)
|
swap_allocno_copy_ends_if_necessary (ira_copy_t cp)
|
||||||
{
|
{
|
||||||
ira_allocno_t temp;
|
|
||||||
ira_copy_t temp_cp;
|
|
||||||
|
|
||||||
if (ALLOCNO_NUM (cp->first) <= ALLOCNO_NUM (cp->second))
|
if (ALLOCNO_NUM (cp->first) <= ALLOCNO_NUM (cp->second))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
temp = cp->first;
|
std::swap (cp->first, cp->second);
|
||||||
cp->first = cp->second;
|
std::swap (cp->prev_first_allocno_copy, cp->prev_second_allocno_copy);
|
||||||
cp->second = temp;
|
std::swap (cp->next_first_allocno_copy, cp->next_second_allocno_copy);
|
||||||
|
|
||||||
temp_cp = cp->prev_first_allocno_copy;
|
|
||||||
cp->prev_first_allocno_copy = cp->prev_second_allocno_copy;
|
|
||||||
cp->prev_second_allocno_copy = temp_cp;
|
|
||||||
|
|
||||||
temp_cp = cp->next_first_allocno_copy;
|
|
||||||
cp->next_first_allocno_copy = cp->next_second_allocno_copy;
|
|
||||||
cp->next_second_allocno_copy = temp_cp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create (or update frequency if the copy already exists) and return
|
/* Create (or update frequency if the copy already exists) and return
|
||||||
|
|
|
@ -1808,7 +1808,6 @@ ira_setup_alts (rtx_insn *insn, HARD_REG_SET &alts)
|
||||||
int nop, nalt;
|
int nop, nalt;
|
||||||
bool curr_swapped;
|
bool curr_swapped;
|
||||||
const char *p;
|
const char *p;
|
||||||
rtx op;
|
|
||||||
int commutative = -1;
|
int commutative = -1;
|
||||||
|
|
||||||
extract_insn (insn);
|
extract_insn (insn);
|
||||||
|
@ -1850,7 +1849,7 @@ ira_setup_alts (rtx_insn *insn, HARD_REG_SET &alts)
|
||||||
{
|
{
|
||||||
int c, len;
|
int c, len;
|
||||||
|
|
||||||
op = recog_data.operand[nop];
|
rtx op = recog_data.operand[nop];
|
||||||
p = insn_constraints[nop * recog_data.n_alternatives + nalt];
|
p = insn_constraints[nop * recog_data.n_alternatives + nalt];
|
||||||
if (*p == 0 || *p == ',')
|
if (*p == 0 || *p == ',')
|
||||||
continue;
|
continue;
|
||||||
|
@ -1923,10 +1922,8 @@ ira_setup_alts (rtx_insn *insn, HARD_REG_SET &alts)
|
||||||
break;
|
break;
|
||||||
if (curr_swapped)
|
if (curr_swapped)
|
||||||
break;
|
break;
|
||||||
op = recog_data.operand[commutative];
|
std::swap (recog_data.operand[commutative],
|
||||||
recog_data.operand[commutative] = recog_data.operand[commutative + 1];
|
recog_data.operand[commutative + 1]);
|
||||||
recog_data.operand[commutative + 1] = op;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -977,7 +977,7 @@ bool
|
||||||
iv_analyze_expr (rtx_insn *insn, rtx rhs, machine_mode mode,
|
iv_analyze_expr (rtx_insn *insn, rtx rhs, machine_mode mode,
|
||||||
struct rtx_iv *iv)
|
struct rtx_iv *iv)
|
||||||
{
|
{
|
||||||
rtx mby = NULL_RTX, tmp;
|
rtx mby = NULL_RTX;
|
||||||
rtx op0 = NULL_RTX, op1 = NULL_RTX;
|
rtx op0 = NULL_RTX, op1 = NULL_RTX;
|
||||||
struct rtx_iv iv0, iv1;
|
struct rtx_iv iv0, iv1;
|
||||||
enum rtx_code code = GET_CODE (rhs);
|
enum rtx_code code = GET_CODE (rhs);
|
||||||
|
@ -1028,11 +1028,7 @@ iv_analyze_expr (rtx_insn *insn, rtx rhs, machine_mode mode,
|
||||||
op0 = XEXP (rhs, 0);
|
op0 = XEXP (rhs, 0);
|
||||||
mby = XEXP (rhs, 1);
|
mby = XEXP (rhs, 1);
|
||||||
if (!CONSTANT_P (mby))
|
if (!CONSTANT_P (mby))
|
||||||
{
|
std::swap (op0, mby);
|
||||||
tmp = op0;
|
|
||||||
op0 = mby;
|
|
||||||
mby = tmp;
|
|
||||||
}
|
|
||||||
if (!CONSTANT_P (mby))
|
if (!CONSTANT_P (mby))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
@ -1544,7 +1540,7 @@ replace_in_expr (rtx *expr, rtx dest, rtx src)
|
||||||
static bool
|
static bool
|
||||||
implies_p (rtx a, rtx b)
|
implies_p (rtx a, rtx b)
|
||||||
{
|
{
|
||||||
rtx op0, op1, opb0, opb1, r;
|
rtx op0, op1, opb0, opb1;
|
||||||
machine_mode mode;
|
machine_mode mode;
|
||||||
|
|
||||||
if (rtx_equal_p (a, b))
|
if (rtx_equal_p (a, b))
|
||||||
|
@ -1559,7 +1555,7 @@ implies_p (rtx a, rtx b)
|
||||||
|| (GET_CODE (op0) == SUBREG
|
|| (GET_CODE (op0) == SUBREG
|
||||||
&& REG_P (SUBREG_REG (op0))))
|
&& REG_P (SUBREG_REG (op0))))
|
||||||
{
|
{
|
||||||
r = simplify_replace_rtx (b, op0, op1);
|
rtx r = simplify_replace_rtx (b, op0, op1);
|
||||||
if (r == const_true_rtx)
|
if (r == const_true_rtx)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1568,7 +1564,7 @@ implies_p (rtx a, rtx b)
|
||||||
|| (GET_CODE (op1) == SUBREG
|
|| (GET_CODE (op1) == SUBREG
|
||||||
&& REG_P (SUBREG_REG (op1))))
|
&& REG_P (SUBREG_REG (op1))))
|
||||||
{
|
{
|
||||||
r = simplify_replace_rtx (b, op1, op0);
|
rtx r = simplify_replace_rtx (b, op1, op0);
|
||||||
if (r == const_true_rtx)
|
if (r == const_true_rtx)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1604,18 +1600,10 @@ implies_p (rtx a, rtx b)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (GET_CODE (a) == GT)
|
if (GET_CODE (a) == GT)
|
||||||
{
|
std::swap (op0, op1);
|
||||||
r = op0;
|
|
||||||
op0 = op1;
|
|
||||||
op1 = r;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GET_CODE (b) == GE)
|
if (GET_CODE (b) == GE)
|
||||||
{
|
std::swap (opb0, opb1);
|
||||||
r = opb0;
|
|
||||||
opb0 = opb1;
|
|
||||||
opb1 = r;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SCALAR_INT_MODE_P (mode)
|
if (SCALAR_INT_MODE_P (mode)
|
||||||
&& rtx_equal_p (op1, opb1)
|
&& rtx_equal_p (op1, opb1)
|
||||||
|
@ -1707,7 +1695,6 @@ implies_p (rtx a, rtx b)
|
||||||
rtx
|
rtx
|
||||||
canon_condition (rtx cond)
|
canon_condition (rtx cond)
|
||||||
{
|
{
|
||||||
rtx tem;
|
|
||||||
rtx op0, op1;
|
rtx op0, op1;
|
||||||
enum rtx_code code;
|
enum rtx_code code;
|
||||||
machine_mode mode;
|
machine_mode mode;
|
||||||
|
@ -1719,9 +1706,7 @@ canon_condition (rtx cond)
|
||||||
if (swap_commutative_operands_p (op0, op1))
|
if (swap_commutative_operands_p (op0, op1))
|
||||||
{
|
{
|
||||||
code = swap_condition (code);
|
code = swap_condition (code);
|
||||||
tem = op0;
|
std::swap (op0, op1);
|
||||||
op0 = op1;
|
|
||||||
op1 = tem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mode = GET_MODE (op0);
|
mode = GET_MODE (op0);
|
||||||
|
|
|
@ -3293,15 +3293,9 @@ simple_move_p (void)
|
||||||
static inline void
|
static inline void
|
||||||
swap_operands (int nop)
|
swap_operands (int nop)
|
||||||
{
|
{
|
||||||
machine_mode mode = curr_operand_mode[nop];
|
std::swap (curr_operand_mode[nop], curr_operand_mode[nop + 1]);
|
||||||
curr_operand_mode[nop] = curr_operand_mode[nop + 1];
|
std::swap (original_subreg_reg_mode[nop], original_subreg_reg_mode[nop + 1]);
|
||||||
curr_operand_mode[nop + 1] = mode;
|
std::swap (*curr_id->operand_loc[nop], *curr_id->operand_loc[nop + 1]);
|
||||||
mode = original_subreg_reg_mode[nop];
|
|
||||||
original_subreg_reg_mode[nop] = original_subreg_reg_mode[nop + 1];
|
|
||||||
original_subreg_reg_mode[nop + 1] = mode;
|
|
||||||
rtx x = *curr_id->operand_loc[nop];
|
|
||||||
*curr_id->operand_loc[nop] = *curr_id->operand_loc[nop + 1];
|
|
||||||
*curr_id->operand_loc[nop + 1] = x;
|
|
||||||
/* Swap the duplicates too. */
|
/* Swap the duplicates too. */
|
||||||
lra_update_dup (curr_id, nop);
|
lra_update_dup (curr_id, nop);
|
||||||
lra_update_dup (curr_id, nop + 1);
|
lra_update_dup (curr_id, nop + 1);
|
||||||
|
|
|
@ -192,7 +192,7 @@ lra_copy_live_range_list (lra_live_range_t r)
|
||||||
lra_live_range_t
|
lra_live_range_t
|
||||||
lra_merge_live_ranges (lra_live_range_t r1, lra_live_range_t r2)
|
lra_merge_live_ranges (lra_live_range_t r1, lra_live_range_t r2)
|
||||||
{
|
{
|
||||||
lra_live_range_t first, last, temp;
|
lra_live_range_t first, last;
|
||||||
|
|
||||||
if (r1 == NULL)
|
if (r1 == NULL)
|
||||||
return r2;
|
return r2;
|
||||||
|
@ -201,16 +201,13 @@ lra_merge_live_ranges (lra_live_range_t r1, lra_live_range_t r2)
|
||||||
for (first = last = NULL; r1 != NULL && r2 != NULL;)
|
for (first = last = NULL; r1 != NULL && r2 != NULL;)
|
||||||
{
|
{
|
||||||
if (r1->start < r2->start)
|
if (r1->start < r2->start)
|
||||||
{
|
std::swap (r1, r2);
|
||||||
temp = r1;
|
|
||||||
r1 = r2;
|
|
||||||
r2 = temp;
|
|
||||||
}
|
|
||||||
if (r1->start == r2->finish + 1)
|
if (r1->start == r2->finish + 1)
|
||||||
{
|
{
|
||||||
/* Joint ranges: merge r1 and r2 into r1. */
|
/* Joint ranges: merge r1 and r2 into r1. */
|
||||||
r1->start = r2->start;
|
r1->start = r2->start;
|
||||||
temp = r2;
|
lra_live_range_t temp = r2;
|
||||||
r2 = r2->next;
|
r2 = r2->next;
|
||||||
pool_free (live_range_pool, temp);
|
pool_free (live_range_pool, temp);
|
||||||
}
|
}
|
||||||
|
|
53
gcc/omega.c
53
gcc/omega.c
|
@ -1882,28 +1882,6 @@ cleanout_wildcards (omega_pb pb)
|
||||||
normalize_omega_problem (pb);
|
normalize_omega_problem (pb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Swap values contained in I and J. */
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
swap (int *i, int *j)
|
|
||||||
{
|
|
||||||
int tmp;
|
|
||||||
tmp = *i;
|
|
||||||
*i = *j;
|
|
||||||
*j = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Swap values contained in I and J. */
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
bswap (bool *i, bool *j)
|
|
||||||
{
|
|
||||||
bool tmp;
|
|
||||||
tmp = *i;
|
|
||||||
*i = *j;
|
|
||||||
*j = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make variable IDX unprotected in PB, by swapping its index at the
|
/* Make variable IDX unprotected in PB, by swapping its index at the
|
||||||
PB->safe_vars rank. */
|
PB->safe_vars rank. */
|
||||||
|
|
||||||
|
@ -1920,19 +1898,19 @@ omega_unprotect_1 (omega_pb pb, int *idx, bool *unprotect)
|
||||||
for (e = pb->num_geqs - 1; e >= 0; e--)
|
for (e = pb->num_geqs - 1; e >= 0; e--)
|
||||||
{
|
{
|
||||||
pb->geqs[e].touched = 1;
|
pb->geqs[e].touched = 1;
|
||||||
swap (&pb->geqs[e].coef[*idx], &pb->geqs[e].coef[j]);
|
std::swap (pb->geqs[e].coef[*idx], pb->geqs[e].coef[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (e = pb->num_eqs - 1; e >= 0; e--)
|
for (e = pb->num_eqs - 1; e >= 0; e--)
|
||||||
swap (&pb->eqs[e].coef[*idx], &pb->eqs[e].coef[j]);
|
std::swap (pb->eqs[e].coef[*idx], pb->eqs[e].coef[j]);
|
||||||
|
|
||||||
for (e = pb->num_subs - 1; e >= 0; e--)
|
for (e = pb->num_subs - 1; e >= 0; e--)
|
||||||
swap (&pb->subs[e].coef[*idx], &pb->subs[e].coef[j]);
|
std::swap (pb->subs[e].coef[*idx], pb->subs[e].coef[j]);
|
||||||
|
|
||||||
if (unprotect)
|
if (unprotect)
|
||||||
bswap (&unprotect[*idx], &unprotect[j]);
|
std::swap (unprotect[*idx], unprotect[j]);
|
||||||
|
|
||||||
swap (&pb->var[*idx], &pb->var[j]);
|
std::swap (pb->var[*idx], pb->var[j]);
|
||||||
pb->forwarding_address[pb->var[*idx]] = *idx;
|
pb->forwarding_address[pb->var[*idx]] = *idx;
|
||||||
pb->forwarding_address[pb->var[j]] = j;
|
pb->forwarding_address[pb->var[j]] = j;
|
||||||
(*idx)--;
|
(*idx)--;
|
||||||
|
@ -3999,7 +3977,6 @@ omega_solve_geq (omega_pb pb, enum omega_result desired_res)
|
||||||
|
|
||||||
if (i != n_vars)
|
if (i != n_vars)
|
||||||
{
|
{
|
||||||
int t;
|
|
||||||
int j = pb->num_vars;
|
int j = pb->num_vars;
|
||||||
|
|
||||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||||
|
@ -4008,24 +3985,18 @@ omega_solve_geq (omega_pb pb, enum omega_result desired_res)
|
||||||
omega_print_problem (dump_file, pb);
|
omega_print_problem (dump_file, pb);
|
||||||
}
|
}
|
||||||
|
|
||||||
swap (&pb->var[i], &pb->var[j]);
|
std::swap (pb->var[i], pb->var[j]);
|
||||||
|
|
||||||
for (e = pb->num_geqs - 1; e >= 0; e--)
|
for (e = pb->num_geqs - 1; e >= 0; e--)
|
||||||
if (pb->geqs[e].coef[i] != pb->geqs[e].coef[j])
|
if (pb->geqs[e].coef[i] != pb->geqs[e].coef[j])
|
||||||
{
|
{
|
||||||
pb->geqs[e].touched = 1;
|
pb->geqs[e].touched = 1;
|
||||||
t = pb->geqs[e].coef[i];
|
std::swap (pb->geqs[e].coef[i], pb->geqs[e].coef[j]);
|
||||||
pb->geqs[e].coef[i] = pb->geqs[e].coef[j];
|
|
||||||
pb->geqs[e].coef[j] = t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (e = pb->num_subs - 1; e >= 0; e--)
|
for (e = pb->num_subs - 1; e >= 0; e--)
|
||||||
if (pb->subs[e].coef[i] != pb->subs[e].coef[j])
|
if (pb->subs[e].coef[i] != pb->subs[e].coef[j])
|
||||||
{
|
std::swap (pb->subs[e].coef[i], pb->subs[e].coef[j]);
|
||||||
t = pb->subs[e].coef[i];
|
|
||||||
pb->subs[e].coef[i] = pb->subs[e].coef[j];
|
|
||||||
pb->subs[e].coef[j] = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||||
{
|
{
|
||||||
|
@ -4624,16 +4595,14 @@ omega_solve_geq (omega_pb pb, enum omega_result desired_res)
|
||||||
/* Sort array LOWER_BOUND. */
|
/* Sort array LOWER_BOUND. */
|
||||||
for (j = 0; j < lower_bounds; j++)
|
for (j = 0; j < lower_bounds; j++)
|
||||||
{
|
{
|
||||||
int k, smallest = j;
|
int smallest = j;
|
||||||
|
|
||||||
for (k = j + 1; k < lower_bounds; k++)
|
for (int k = j + 1; k < lower_bounds; k++)
|
||||||
if (pb->geqs[lower_bound[smallest]].coef[i] >
|
if (pb->geqs[lower_bound[smallest]].coef[i] >
|
||||||
pb->geqs[lower_bound[k]].coef[i])
|
pb->geqs[lower_bound[k]].coef[i])
|
||||||
smallest = k;
|
smallest = k;
|
||||||
|
|
||||||
k = lower_bound[smallest];
|
std::swap (lower_bound[smallest], lower_bound[j]);
|
||||||
lower_bound[smallest] = lower_bound[j];
|
|
||||||
lower_bound[j] = k;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||||
|
|
35
gcc/optabs.c
35
gcc/optabs.c
|
@ -1418,7 +1418,6 @@ expand_binop_directly (machine_mode mode, optab binoptab,
|
||||||
bool commutative_p;
|
bool commutative_p;
|
||||||
rtx pat;
|
rtx pat;
|
||||||
rtx xop0 = op0, xop1 = op1;
|
rtx xop0 = op0, xop1 = op1;
|
||||||
rtx swap;
|
|
||||||
|
|
||||||
/* If it is a commutative operator and the modes would match
|
/* If it is a commutative operator and the modes would match
|
||||||
if we would swap the operands, we can save the conversions. */
|
if we would swap the operands, we can save the conversions. */
|
||||||
|
@ -1426,11 +1425,7 @@ expand_binop_directly (machine_mode mode, optab binoptab,
|
||||||
if (commutative_p
|
if (commutative_p
|
||||||
&& GET_MODE (xop0) != xmode0 && GET_MODE (xop1) != xmode1
|
&& GET_MODE (xop0) != xmode0 && GET_MODE (xop1) != xmode1
|
||||||
&& GET_MODE (xop0) == xmode1 && GET_MODE (xop1) == xmode1)
|
&& GET_MODE (xop0) == xmode1 && GET_MODE (xop1) == xmode1)
|
||||||
{
|
std::swap (xop0, xop1);
|
||||||
swap = xop0;
|
|
||||||
xop0 = xop1;
|
|
||||||
xop1 = swap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If we are optimizing, force expensive constants into a register. */
|
/* If we are optimizing, force expensive constants into a register. */
|
||||||
xop0 = avoid_expensive_constant (xmode0, binoptab, 0, xop0, unsignedp);
|
xop0 = avoid_expensive_constant (xmode0, binoptab, 0, xop0, unsignedp);
|
||||||
|
@ -1463,11 +1458,7 @@ expand_binop_directly (machine_mode mode, optab binoptab,
|
||||||
Also try to make the last operand a constant. */
|
Also try to make the last operand a constant. */
|
||||||
if (commutative_p
|
if (commutative_p
|
||||||
&& swap_commutative_operands_with_target (target, xop0, xop1))
|
&& swap_commutative_operands_with_target (target, xop0, xop1))
|
||||||
{
|
std::swap (xop0, xop1);
|
||||||
swap = xop1;
|
|
||||||
xop1 = xop0;
|
|
||||||
xop0 = swap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now, if insn's predicates don't allow our operands, put them into
|
/* Now, if insn's predicates don't allow our operands, put them into
|
||||||
pseudo regs. */
|
pseudo regs. */
|
||||||
|
@ -1722,11 +1713,7 @@ expand_binop (machine_mode mode, optab binoptab, rtx op0, rtx op1,
|
||||||
Also try to make the last operand a constant. */
|
Also try to make the last operand a constant. */
|
||||||
if (commutative_optab_p (binoptab)
|
if (commutative_optab_p (binoptab)
|
||||||
&& swap_commutative_operands_with_target (target, op0, op1))
|
&& swap_commutative_operands_with_target (target, op0, op1))
|
||||||
{
|
std::swap (op0, op1);
|
||||||
temp = op1;
|
|
||||||
op1 = op0;
|
|
||||||
op0 = temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* These can be done a word at a time. */
|
/* These can be done a word at a time. */
|
||||||
if ((binoptab == and_optab || binoptab == ior_optab || binoptab == xor_optab)
|
if ((binoptab == and_optab || binoptab == ior_optab || binoptab == xor_optab)
|
||||||
|
@ -4553,7 +4540,7 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
||||||
machine_mode cmode, rtx op2, rtx op3,
|
machine_mode cmode, rtx op2, rtx op3,
|
||||||
machine_mode mode, int unsignedp)
|
machine_mode mode, int unsignedp)
|
||||||
{
|
{
|
||||||
rtx tem, comparison;
|
rtx comparison;
|
||||||
rtx_insn *last;
|
rtx_insn *last;
|
||||||
enum insn_code icode;
|
enum insn_code icode;
|
||||||
enum rtx_code reversed;
|
enum rtx_code reversed;
|
||||||
|
@ -4563,9 +4550,7 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
||||||
|
|
||||||
if (swap_commutative_operands_p (op0, op1))
|
if (swap_commutative_operands_p (op0, op1))
|
||||||
{
|
{
|
||||||
tem = op0;
|
std::swap (op0, op1);
|
||||||
op0 = op1;
|
|
||||||
op1 = tem;
|
|
||||||
code = swap_condition (code);
|
code = swap_condition (code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4584,9 +4569,7 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
||||||
&& ((reversed = reversed_comparison_code_parts (code, op0, op1, NULL))
|
&& ((reversed = reversed_comparison_code_parts (code, op0, op1, NULL))
|
||||||
!= UNKNOWN))
|
!= UNKNOWN))
|
||||||
{
|
{
|
||||||
tem = op2;
|
std::swap (op2, op3);
|
||||||
op2 = op3;
|
|
||||||
op3 = tem;
|
|
||||||
code = reversed;
|
code = reversed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4675,7 +4658,7 @@ emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
||||||
machine_mode cmode, rtx op2, rtx op3,
|
machine_mode cmode, rtx op2, rtx op3,
|
||||||
machine_mode mode, int unsignedp)
|
machine_mode mode, int unsignedp)
|
||||||
{
|
{
|
||||||
rtx tem, comparison;
|
rtx comparison;
|
||||||
rtx_insn *last;
|
rtx_insn *last;
|
||||||
enum insn_code icode;
|
enum insn_code icode;
|
||||||
|
|
||||||
|
@ -4684,9 +4667,7 @@ emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
||||||
|
|
||||||
if (swap_commutative_operands_p (op0, op1))
|
if (swap_commutative_operands_p (op0, op1))
|
||||||
{
|
{
|
||||||
tem = op0;
|
std::swap (op0, op1);
|
||||||
op0 = op1;
|
|
||||||
op1 = tem;
|
|
||||||
code = swap_condition (code);
|
code = swap_condition (code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -632,7 +632,6 @@ reload_cse_simplify_operands (rtx_insn *insn, rtx testreg)
|
||||||
int best = i;
|
int best = i;
|
||||||
int best_reject = alternative_reject[alternative_order[i]];
|
int best_reject = alternative_reject[alternative_order[i]];
|
||||||
int best_nregs = alternative_nregs[alternative_order[i]];
|
int best_nregs = alternative_nregs[alternative_order[i]];
|
||||||
int tmp;
|
|
||||||
|
|
||||||
for (j = i + 1; j < recog_data.n_alternatives; j++)
|
for (j = i + 1; j < recog_data.n_alternatives; j++)
|
||||||
{
|
{
|
||||||
|
@ -648,9 +647,7 @@ reload_cse_simplify_operands (rtx_insn *insn, rtx testreg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = alternative_order[best];
|
std::swap (alternative_order[best], alternative_order[i]);
|
||||||
alternative_order[best] = alternative_order[i];
|
|
||||||
alternative_order[i] = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Substitute the operands as determined by op_alt_regno for the best
|
/* Substitute the operands as determined by op_alt_regno for the best
|
||||||
|
|
|
@ -812,7 +812,7 @@ emit_swap_insn (rtx_insn *insn, stack_ptr regstack, rtx reg)
|
||||||
{
|
{
|
||||||
int hard_regno;
|
int hard_regno;
|
||||||
rtx swap_rtx;
|
rtx swap_rtx;
|
||||||
int tmp, other_reg; /* swap regno temps */
|
int other_reg; /* swap regno temps */
|
||||||
rtx_insn *i1; /* the stack-reg insn prior to INSN */
|
rtx_insn *i1; /* the stack-reg insn prior to INSN */
|
||||||
rtx i1set = NULL_RTX; /* the SET rtx within I1 */
|
rtx i1set = NULL_RTX; /* the SET rtx within I1 */
|
||||||
|
|
||||||
|
@ -833,10 +833,7 @@ emit_swap_insn (rtx_insn *insn, stack_ptr regstack, rtx reg)
|
||||||
gcc_assert (hard_regno >= FIRST_STACK_REG);
|
gcc_assert (hard_regno >= FIRST_STACK_REG);
|
||||||
|
|
||||||
other_reg = regstack->top - (hard_regno - FIRST_STACK_REG);
|
other_reg = regstack->top - (hard_regno - FIRST_STACK_REG);
|
||||||
|
std::swap (regstack->reg[regstack->top], regstack->reg[other_reg]);
|
||||||
tmp = regstack->reg[other_reg];
|
|
||||||
regstack->reg[other_reg] = regstack->reg[regstack->top];
|
|
||||||
regstack->reg[regstack->top] = tmp;
|
|
||||||
|
|
||||||
/* Find the previous insn involving stack regs, but don't pass a
|
/* Find the previous insn involving stack regs, but don't pass a
|
||||||
block boundary. */
|
block boundary. */
|
||||||
|
@ -918,7 +915,7 @@ static void
|
||||||
swap_to_top (rtx_insn *insn, stack_ptr regstack, rtx src1, rtx src2)
|
swap_to_top (rtx_insn *insn, stack_ptr regstack, rtx src1, rtx src2)
|
||||||
{
|
{
|
||||||
struct stack_def temp_stack;
|
struct stack_def temp_stack;
|
||||||
int regno, j, k, temp;
|
int regno, j, k;
|
||||||
|
|
||||||
temp_stack = *regstack;
|
temp_stack = *regstack;
|
||||||
|
|
||||||
|
@ -930,9 +927,7 @@ swap_to_top (rtx_insn *insn, stack_ptr regstack, rtx src1, rtx src2)
|
||||||
k = temp_stack.top - (regno - FIRST_STACK_REG);
|
k = temp_stack.top - (regno - FIRST_STACK_REG);
|
||||||
j = temp_stack.top;
|
j = temp_stack.top;
|
||||||
|
|
||||||
temp = temp_stack.reg[k];
|
std::swap (temp_stack.reg[j], temp_stack.reg[k]);
|
||||||
temp_stack.reg[k] = temp_stack.reg[j];
|
|
||||||
temp_stack.reg[j] = temp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Place operand 2 next on the stack. */
|
/* Place operand 2 next on the stack. */
|
||||||
|
@ -943,9 +938,7 @@ swap_to_top (rtx_insn *insn, stack_ptr regstack, rtx src1, rtx src2)
|
||||||
k = temp_stack.top - (regno - FIRST_STACK_REG);
|
k = temp_stack.top - (regno - FIRST_STACK_REG);
|
||||||
j = temp_stack.top - 1;
|
j = temp_stack.top - 1;
|
||||||
|
|
||||||
temp = temp_stack.reg[k];
|
std::swap (temp_stack.reg[j], temp_stack.reg[k]);
|
||||||
temp_stack.reg[k] = temp_stack.reg[j];
|
|
||||||
temp_stack.reg[j] = temp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
change_stack (insn, regstack, &temp_stack, EMIT_BEFORE);
|
change_stack (insn, regstack, &temp_stack, EMIT_BEFORE);
|
||||||
|
@ -1261,10 +1254,7 @@ compare_for_stack_reg (rtx_insn *insn, stack_ptr regstack, rtx pat_src)
|
||||||
&& get_hard_regnum (regstack, *src2) == FIRST_STACK_REG))
|
&& get_hard_regnum (regstack, *src2) == FIRST_STACK_REG))
|
||||||
&& swap_rtx_condition (insn))
|
&& swap_rtx_condition (insn))
|
||||||
{
|
{
|
||||||
rtx temp;
|
std::swap (XEXP (pat_src, 0), XEXP (pat_src, 1));
|
||||||
temp = XEXP (pat_src, 0);
|
|
||||||
XEXP (pat_src, 0) = XEXP (pat_src, 1);
|
|
||||||
XEXP (pat_src, 1) = temp;
|
|
||||||
|
|
||||||
src1 = get_true_reg (&XEXP (pat_src, 0));
|
src1 = get_true_reg (&XEXP (pat_src, 0));
|
||||||
src2 = get_true_reg (&XEXP (pat_src, 1));
|
src2 = get_true_reg (&XEXP (pat_src, 1));
|
||||||
|
@ -2139,15 +2129,13 @@ subst_asm_stack_regs (rtx_insn *insn, stack_ptr regstack)
|
||||||
it and swap it with whatever is already in I's place.
|
it and swap it with whatever is already in I's place.
|
||||||
K is where recog_data.operand[i] is now. J is where it
|
K is where recog_data.operand[i] is now. J is where it
|
||||||
should be. */
|
should be. */
|
||||||
int j, k, temp;
|
int j, k;
|
||||||
|
|
||||||
k = temp_stack.top - (regno - FIRST_STACK_REG);
|
k = temp_stack.top - (regno - FIRST_STACK_REG);
|
||||||
j = (temp_stack.top
|
j = (temp_stack.top
|
||||||
- (REGNO (recog_data.operand[i]) - FIRST_STACK_REG));
|
- (REGNO (recog_data.operand[i]) - FIRST_STACK_REG));
|
||||||
|
|
||||||
temp = temp_stack.reg[k];
|
std::swap (temp_stack.reg[j], temp_stack.reg[k]);
|
||||||
temp_stack.reg[k] = temp_stack.reg[j];
|
|
||||||
temp_stack.reg[j] = temp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
58
gcc/reload.c
58
gcc/reload.c
|
@ -3064,9 +3064,6 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known,
|
||||||
|
|
||||||
if (swapped)
|
if (swapped)
|
||||||
{
|
{
|
||||||
enum reg_class tclass;
|
|
||||||
int t;
|
|
||||||
|
|
||||||
recog_data.operand[commutative] = substed_operand[commutative + 1];
|
recog_data.operand[commutative] = substed_operand[commutative + 1];
|
||||||
recog_data.operand[commutative + 1] = substed_operand[commutative];
|
recog_data.operand[commutative + 1] = substed_operand[commutative];
|
||||||
/* Swap the duplicates too. */
|
/* Swap the duplicates too. */
|
||||||
|
@ -3076,17 +3073,12 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known,
|
||||||
*recog_data.dup_loc[i]
|
*recog_data.dup_loc[i]
|
||||||
= recog_data.operand[(int) recog_data.dup_num[i]];
|
= recog_data.operand[(int) recog_data.dup_num[i]];
|
||||||
|
|
||||||
tclass = preferred_class[commutative];
|
std::swap (preferred_class[commutative],
|
||||||
preferred_class[commutative] = preferred_class[commutative + 1];
|
preferred_class[commutative + 1]);
|
||||||
preferred_class[commutative + 1] = tclass;
|
std::swap (pref_or_nothing[commutative],
|
||||||
|
pref_or_nothing[commutative + 1]);
|
||||||
t = pref_or_nothing[commutative];
|
std::swap (address_reloaded[commutative],
|
||||||
pref_or_nothing[commutative] = pref_or_nothing[commutative + 1];
|
address_reloaded[commutative + 1]);
|
||||||
pref_or_nothing[commutative + 1] = t;
|
|
||||||
|
|
||||||
t = address_reloaded[commutative];
|
|
||||||
address_reloaded[commutative] = address_reloaded[commutative + 1];
|
|
||||||
address_reloaded[commutative + 1] = t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this_earlyclobber = 0;
|
this_earlyclobber = 0;
|
||||||
|
@ -3818,9 +3810,6 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known,
|
||||||
|
|
||||||
if (swapped)
|
if (swapped)
|
||||||
{
|
{
|
||||||
enum reg_class tclass;
|
|
||||||
int t;
|
|
||||||
|
|
||||||
/* If the commutative operands have been swapped, swap
|
/* If the commutative operands have been swapped, swap
|
||||||
them back in order to check the next alternative. */
|
them back in order to check the next alternative. */
|
||||||
recog_data.operand[commutative] = substed_operand[commutative];
|
recog_data.operand[commutative] = substed_operand[commutative];
|
||||||
|
@ -3833,17 +3822,12 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known,
|
||||||
= recog_data.operand[(int) recog_data.dup_num[i]];
|
= recog_data.operand[(int) recog_data.dup_num[i]];
|
||||||
|
|
||||||
/* Unswap the operand related information as well. */
|
/* Unswap the operand related information as well. */
|
||||||
tclass = preferred_class[commutative];
|
std::swap (preferred_class[commutative],
|
||||||
preferred_class[commutative] = preferred_class[commutative + 1];
|
preferred_class[commutative + 1]);
|
||||||
preferred_class[commutative + 1] = tclass;
|
std::swap (pref_or_nothing[commutative],
|
||||||
|
pref_or_nothing[commutative + 1]);
|
||||||
t = pref_or_nothing[commutative];
|
std::swap (address_reloaded[commutative],
|
||||||
pref_or_nothing[commutative] = pref_or_nothing[commutative + 1];
|
address_reloaded[commutative + 1]);
|
||||||
pref_or_nothing[commutative + 1] = t;
|
|
||||||
|
|
||||||
t = address_reloaded[commutative];
|
|
||||||
address_reloaded[commutative] = address_reloaded[commutative + 1];
|
|
||||||
address_reloaded[commutative + 1] = t;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3892,18 +3876,12 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known,
|
||||||
|
|
||||||
if (goal_alternative_swapped)
|
if (goal_alternative_swapped)
|
||||||
{
|
{
|
||||||
rtx tem;
|
std::swap (substed_operand[commutative],
|
||||||
|
substed_operand[commutative + 1]);
|
||||||
tem = substed_operand[commutative];
|
std::swap (recog_data.operand[commutative],
|
||||||
substed_operand[commutative] = substed_operand[commutative + 1];
|
recog_data.operand[commutative + 1]);
|
||||||
substed_operand[commutative + 1] = tem;
|
std::swap (*recog_data.operand_loc[commutative],
|
||||||
tem = recog_data.operand[commutative];
|
*recog_data.operand_loc[commutative + 1]);
|
||||||
recog_data.operand[commutative] = recog_data.operand[commutative + 1];
|
|
||||||
recog_data.operand[commutative + 1] = tem;
|
|
||||||
tem = *recog_data.operand_loc[commutative];
|
|
||||||
*recog_data.operand_loc[commutative]
|
|
||||||
= *recog_data.operand_loc[commutative + 1];
|
|
||||||
*recog_data.operand_loc[commutative + 1] = tem;
|
|
||||||
|
|
||||||
for (i = 0; i < n_reloads; i++)
|
for (i = 0; i < n_reloads; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5707,18 +5707,15 @@ gen_reload_chain_without_interm_reg_p (int r1, int r2)
|
||||||
/* Assume other cases in gen_reload are not possible for
|
/* Assume other cases in gen_reload are not possible for
|
||||||
chain reloads or do need an intermediate hard registers. */
|
chain reloads or do need an intermediate hard registers. */
|
||||||
bool result = true;
|
bool result = true;
|
||||||
int regno, n, code;
|
int regno, code;
|
||||||
rtx out, in;
|
rtx out, in;
|
||||||
rtx_insn *insn;
|
rtx_insn *insn;
|
||||||
rtx_insn *last = get_last_insn ();
|
rtx_insn *last = get_last_insn ();
|
||||||
|
|
||||||
/* Make r2 a component of r1. */
|
/* Make r2 a component of r1. */
|
||||||
if (reg_mentioned_p (rld[r1].in, rld[r2].in))
|
if (reg_mentioned_p (rld[r1].in, rld[r2].in))
|
||||||
{
|
std::swap (r1, r2);
|
||||||
n = r1;
|
|
||||||
r1 = r2;
|
|
||||||
r2 = n;
|
|
||||||
}
|
|
||||||
gcc_assert (reg_mentioned_p (rld[r2].in, rld[r1].in));
|
gcc_assert (reg_mentioned_p (rld[r2].in, rld[r1].in));
|
||||||
regno = rld[r1].regno >= 0 ? rld[r1].regno : rld[r2].regno;
|
regno = rld[r1].regno >= 0 ? rld[r1].regno : rld[r2].regno;
|
||||||
gcc_assert (regno >= 0);
|
gcc_assert (regno >= 0);
|
||||||
|
|
|
@ -4142,16 +4142,12 @@ invoke_reorder_hooks (fence_t fence)
|
||||||
for (i = 0, n = ready.n_ready; i < n; i++)
|
for (i = 0, n = ready.n_ready; i < n; i++)
|
||||||
if (EXPR_INSN_RTX (vec[i]) != arr[i])
|
if (EXPR_INSN_RTX (vec[i]) != arr[i])
|
||||||
{
|
{
|
||||||
expr_t tmp;
|
|
||||||
|
|
||||||
for (j = i; j < n; j++)
|
for (j = i; j < n; j++)
|
||||||
if (EXPR_INSN_RTX (vec[j]) == arr[i])
|
if (EXPR_INSN_RTX (vec[j]) == arr[i])
|
||||||
break;
|
break;
|
||||||
gcc_assert (j < n);
|
gcc_assert (j < n);
|
||||||
|
|
||||||
tmp = vec[i];
|
std::swap (vec[i], vec[j]);
|
||||||
vec[i] = vec[j];
|
|
||||||
vec[j] = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4610,15 +4606,12 @@ create_block_for_bookkeeping (edge e1, edge e2)
|
||||||
{
|
{
|
||||||
sel_global_bb_info_def gbi;
|
sel_global_bb_info_def gbi;
|
||||||
sel_region_bb_info_def rbi;
|
sel_region_bb_info_def rbi;
|
||||||
int i;
|
|
||||||
|
|
||||||
if (sched_verbose >= 2)
|
if (sched_verbose >= 2)
|
||||||
sel_print ("Swapping block ids %i and %i\n",
|
sel_print ("Swapping block ids %i and %i\n",
|
||||||
new_bb->index, succ->index);
|
new_bb->index, succ->index);
|
||||||
|
|
||||||
i = new_bb->index;
|
std::swap (new_bb->index, succ->index);
|
||||||
new_bb->index = succ->index;
|
|
||||||
succ->index = i;
|
|
||||||
|
|
||||||
SET_BASIC_BLOCK_FOR_FN (cfun, new_bb->index, new_bb);
|
SET_BASIC_BLOCK_FOR_FN (cfun, new_bb->index, new_bb);
|
||||||
SET_BASIC_BLOCK_FOR_FN (cfun, succ->index, succ);
|
SET_BASIC_BLOCK_FOR_FN (cfun, succ->index, succ);
|
||||||
|
@ -4633,15 +4626,13 @@ create_block_for_bookkeeping (edge e1, edge e2)
|
||||||
sizeof (rbi));
|
sizeof (rbi));
|
||||||
memcpy (SEL_REGION_BB_INFO (succ), &rbi, sizeof (rbi));
|
memcpy (SEL_REGION_BB_INFO (succ), &rbi, sizeof (rbi));
|
||||||
|
|
||||||
i = BLOCK_TO_BB (new_bb->index);
|
std::swap (BLOCK_TO_BB (new_bb->index),
|
||||||
BLOCK_TO_BB (new_bb->index) = BLOCK_TO_BB (succ->index);
|
BLOCK_TO_BB (succ->index));
|
||||||
BLOCK_TO_BB (succ->index) = i;
|
|
||||||
|
|
||||||
i = CONTAINING_RGN (new_bb->index);
|
std::swap (CONTAINING_RGN (new_bb->index),
|
||||||
CONTAINING_RGN (new_bb->index) = CONTAINING_RGN (succ->index);
|
CONTAINING_RGN (succ->index));
|
||||||
CONTAINING_RGN (succ->index) = i;
|
|
||||||
|
|
||||||
for (i = 0; i < current_nr_blocks; i++)
|
for (int i = 0; i < current_nr_blocks; i++)
|
||||||
if (BB_TO_BLOCK (i) == succ->index)
|
if (BB_TO_BLOCK (i) == succ->index)
|
||||||
BB_TO_BLOCK (i) = new_bb->index;
|
BB_TO_BLOCK (i) = new_bb->index;
|
||||||
else if (BB_TO_BLOCK (i) == new_bb->index)
|
else if (BB_TO_BLOCK (i) == new_bb->index)
|
||||||
|
@ -4666,10 +4657,8 @@ create_block_for_bookkeeping (edge e1, edge e2)
|
||||||
CODE_LABEL_NUMBER (BB_HEAD (new_bb)),
|
CODE_LABEL_NUMBER (BB_HEAD (new_bb)),
|
||||||
CODE_LABEL_NUMBER (BB_HEAD (succ)));
|
CODE_LABEL_NUMBER (BB_HEAD (succ)));
|
||||||
|
|
||||||
i = CODE_LABEL_NUMBER (BB_HEAD (new_bb));
|
std::swap (CODE_LABEL_NUMBER (BB_HEAD (new_bb)),
|
||||||
CODE_LABEL_NUMBER (BB_HEAD (new_bb))
|
CODE_LABEL_NUMBER (BB_HEAD (succ)));
|
||||||
= CODE_LABEL_NUMBER (BB_HEAD (succ));
|
|
||||||
CODE_LABEL_NUMBER (BB_HEAD (succ)) = i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2411,18 +2411,6 @@ lambda_matrix_row_add (lambda_matrix mat, int n, int r1, int r2, int const1)
|
||||||
mat[r2][i] += const1 * mat[r1][i];
|
mat[r2][i] += const1 * mat[r1][i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Swap rows R1 and R2 in matrix MAT. */
|
|
||||||
|
|
||||||
static void
|
|
||||||
lambda_matrix_row_exchange (lambda_matrix mat, int r1, int r2)
|
|
||||||
{
|
|
||||||
lambda_vector row;
|
|
||||||
|
|
||||||
row = mat[r1];
|
|
||||||
mat[r1] = mat[r2];
|
|
||||||
mat[r2] = row;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Multiply vector VEC1 of length SIZE by a constant CONST1,
|
/* Multiply vector VEC1 of length SIZE by a constant CONST1,
|
||||||
and store the result in VEC2. */
|
and store the result in VEC2. */
|
||||||
|
|
||||||
|
@ -2503,10 +2491,10 @@ lambda_matrix_right_hermite (lambda_matrix A, int m, int n,
|
||||||
factor = sigma * (a / b);
|
factor = sigma * (a / b);
|
||||||
|
|
||||||
lambda_matrix_row_add (S, n, i, i-1, -factor);
|
lambda_matrix_row_add (S, n, i, i-1, -factor);
|
||||||
lambda_matrix_row_exchange (S, i, i-1);
|
std::swap (S[i], S[i-1]);
|
||||||
|
|
||||||
lambda_matrix_row_add (U, m, i, i-1, -factor);
|
lambda_matrix_row_add (U, m, i, i-1, -factor);
|
||||||
lambda_matrix_row_exchange (U, i, i-1);
|
std::swap (U[i], U[i-1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,15 +433,13 @@ sort_coalesce_list (coalesce_list_p cl)
|
||||||
if (num == 2)
|
if (num == 2)
|
||||||
{
|
{
|
||||||
if (cl->sorted[0]->cost > cl->sorted[1]->cost)
|
if (cl->sorted[0]->cost > cl->sorted[1]->cost)
|
||||||
{
|
std::swap (cl->sorted[0], cl->sorted[1]);
|
||||||
p = cl->sorted[0];
|
|
||||||
cl->sorted[0] = cl->sorted[1];
|
|
||||||
cl->sorted[1] = p;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only call qsort if there are more than 2 items. */
|
/* Only call qsort if there are more than 2 items.
|
||||||
|
??? Maybe std::sort will do better, provided that compare_pairs
|
||||||
|
can be inlined. */
|
||||||
if (num > 2)
|
if (num > 2)
|
||||||
qsort (cl->sorted, num, sizeof (coalesce_pair_p), compare_pairs);
|
qsort (cl->sorted, num, sizeof (coalesce_pair_p), compare_pairs);
|
||||||
}
|
}
|
||||||
|
|
|
@ -438,25 +438,13 @@ ifcombine_ifandif (basic_block inner_cond_bb, bool inner_inv,
|
||||||
;
|
;
|
||||||
else if (bits1 == bits2)
|
else if (bits1 == bits2)
|
||||||
{
|
{
|
||||||
t = name2;
|
std::swap (name2, bits2);
|
||||||
name2 = bits2;
|
std::swap (name1, bits1);
|
||||||
bits2 = t;
|
|
||||||
t = name1;
|
|
||||||
name1 = bits1;
|
|
||||||
bits1 = t;
|
|
||||||
}
|
}
|
||||||
else if (name1 == bits2)
|
else if (name1 == bits2)
|
||||||
{
|
std::swap (name2, bits2);
|
||||||
t = name2;
|
|
||||||
name2 = bits2;
|
|
||||||
bits2 = t;
|
|
||||||
}
|
|
||||||
else if (bits1 == name2)
|
else if (bits1 == name2)
|
||||||
{
|
std::swap (name1, bits1);
|
||||||
t = name1;
|
|
||||||
name1 = bits1;
|
|
||||||
bits1 = t;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -5587,7 +5587,6 @@ static struct iv_ca_delta *
|
||||||
iv_ca_delta_reverse (struct iv_ca_delta *delta)
|
iv_ca_delta_reverse (struct iv_ca_delta *delta)
|
||||||
{
|
{
|
||||||
struct iv_ca_delta *act, *next, *prev = NULL;
|
struct iv_ca_delta *act, *next, *prev = NULL;
|
||||||
struct cost_pair *tmp;
|
|
||||||
|
|
||||||
for (act = delta; act; act = next)
|
for (act = delta; act; act = next)
|
||||||
{
|
{
|
||||||
|
@ -5595,9 +5594,7 @@ iv_ca_delta_reverse (struct iv_ca_delta *delta)
|
||||||
act->next_change = prev;
|
act->next_change = prev;
|
||||||
prev = act;
|
prev = act;
|
||||||
|
|
||||||
tmp = act->old_cp;
|
std::swap (act->old_cp, act->new_cp);
|
||||||
act->old_cp = act->new_cp;
|
|
||||||
act->new_cp = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return prev;
|
return prev;
|
||||||
|
|
|
@ -3013,13 +3013,8 @@ is_widening_mult_p (gimple stmt,
|
||||||
/* Ensure that the larger of the two operands comes first. */
|
/* Ensure that the larger of the two operands comes first. */
|
||||||
if (TYPE_PRECISION (*type1_out) < TYPE_PRECISION (*type2_out))
|
if (TYPE_PRECISION (*type1_out) < TYPE_PRECISION (*type2_out))
|
||||||
{
|
{
|
||||||
tree tmp;
|
std::swap (*type1_out, *type2_out);
|
||||||
tmp = *type1_out;
|
std::swap (*rhs1_out, *rhs2_out);
|
||||||
*type1_out = *type2_out;
|
|
||||||
*type2_out = tmp;
|
|
||||||
tmp = *rhs1_out;
|
|
||||||
*rhs1_out = *rhs2_out;
|
|
||||||
*rhs2_out = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1911,8 +1911,8 @@ hoist_adjacent_loads (basic_block bb0, basic_block bb1,
|
||||||
for (gsi = gsi_start_phis (bb3); !gsi_end_p (gsi); gsi_next (&gsi))
|
for (gsi = gsi_start_phis (bb3); !gsi_end_p (gsi); gsi_next (&gsi))
|
||||||
{
|
{
|
||||||
gphi *phi_stmt = gsi.phi ();
|
gphi *phi_stmt = gsi.phi ();
|
||||||
gimple def1, def2, defswap;
|
gimple def1, def2;
|
||||||
tree arg1, arg2, ref1, ref2, field1, field2, fieldswap;
|
tree arg1, arg2, ref1, ref2, field1, field2;
|
||||||
tree tree_offset1, tree_offset2, tree_size2, next;
|
tree tree_offset1, tree_offset2, tree_size2, next;
|
||||||
int offset1, offset2, size2;
|
int offset1, offset2, size2;
|
||||||
unsigned align1;
|
unsigned align1;
|
||||||
|
@ -1987,12 +1987,8 @@ hoist_adjacent_loads (basic_block bb0, basic_block bb1,
|
||||||
if (next != field1)
|
if (next != field1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
fieldswap = field1;
|
std::swap (field1, field2);
|
||||||
field1 = field2;
|
std::swap (def1, def2);
|
||||||
field2 = fieldswap;
|
|
||||||
defswap = def1;
|
|
||||||
def1 = def2;
|
|
||||||
def2 = defswap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bb_for_def1 = gimple_bb (def1);
|
bb_for_def1 = gimple_bb (def1);
|
||||||
|
|
|
@ -4117,8 +4117,6 @@ linearize_expr_tree (vec<operand_entry_t> *ops, gimple stmt,
|
||||||
|
|
||||||
if (!binlhsisreassoc)
|
if (!binlhsisreassoc)
|
||||||
{
|
{
|
||||||
tree temp;
|
|
||||||
|
|
||||||
/* If this is not a associative operation like division, give up. */
|
/* If this is not a associative operation like division, give up. */
|
||||||
if (!is_associative)
|
if (!is_associative)
|
||||||
{
|
{
|
||||||
|
@ -4170,9 +4168,7 @@ linearize_expr_tree (vec<operand_entry_t> *ops, gimple stmt,
|
||||||
|
|
||||||
/* We want to make it so the lhs is always the reassociative op,
|
/* We want to make it so the lhs is always the reassociative op,
|
||||||
so swap. */
|
so swap. */
|
||||||
temp = binlhs;
|
std::swap (binlhs, binrhs);
|
||||||
binlhs = binrhs;
|
|
||||||
binrhs = temp;
|
|
||||||
}
|
}
|
||||||
else if (binrhsisreassoc)
|
else if (binrhsisreassoc)
|
||||||
{
|
{
|
||||||
|
|
|
@ -544,11 +544,8 @@ simplify_control_stmt_condition (edge e,
|
||||||
miss threading opportunities. */
|
miss threading opportunities. */
|
||||||
if (tree_swap_operands_p (op0, op1, false))
|
if (tree_swap_operands_p (op0, op1, false))
|
||||||
{
|
{
|
||||||
tree tmp;
|
|
||||||
cond_code = swap_tree_comparison (cond_code);
|
cond_code = swap_tree_comparison (cond_code);
|
||||||
tmp = op0;
|
std::swap (op0, op1);
|
||||||
op0 = op1;
|
|
||||||
op1 = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stuff the operator and operands into our dummy conditional
|
/* Stuff the operator and operands into our dummy conditional
|
||||||
|
|
|
@ -4556,11 +4556,8 @@ compare_ranges (enum tree_code comp, value_range_t *vr0, value_range_t *vr1,
|
||||||
operands around and change the comparison code. */
|
operands around and change the comparison code. */
|
||||||
if (comp == GT_EXPR || comp == GE_EXPR)
|
if (comp == GT_EXPR || comp == GE_EXPR)
|
||||||
{
|
{
|
||||||
value_range_t *tmp;
|
|
||||||
comp = (comp == GT_EXPR) ? LT_EXPR : LE_EXPR;
|
comp = (comp == GT_EXPR) ? LT_EXPR : LE_EXPR;
|
||||||
tmp = vr0;
|
std::swap (vr0, vr1);
|
||||||
vr0 = vr1;
|
|
||||||
vr1 = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comp == EQ_EXPR)
|
if (comp == EQ_EXPR)
|
||||||
|
|
|
@ -6509,13 +6509,7 @@ add_with_sets (rtx_insn *insn, struct cselib_set *sets, int n_sets)
|
||||||
while (n1 < n2 && mos[n2].type != MO_USE)
|
while (n1 < n2 && mos[n2].type != MO_USE)
|
||||||
n2--;
|
n2--;
|
||||||
if (n1 < n2)
|
if (n1 < n2)
|
||||||
{
|
std::swap (mos[n1], mos[n2]);
|
||||||
micro_operation sw;
|
|
||||||
|
|
||||||
sw = mos[n1];
|
|
||||||
mos[n1] = mos[n2];
|
|
||||||
mos[n2] = sw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
n2 = VTI (bb)->mos.length () - 1;
|
n2 = VTI (bb)->mos.length () - 1;
|
||||||
|
@ -6526,13 +6520,7 @@ add_with_sets (rtx_insn *insn, struct cselib_set *sets, int n_sets)
|
||||||
while (n1 < n2 && mos[n2].type == MO_VAL_LOC)
|
while (n1 < n2 && mos[n2].type == MO_VAL_LOC)
|
||||||
n2--;
|
n2--;
|
||||||
if (n1 < n2)
|
if (n1 < n2)
|
||||||
{
|
std::swap (mos[n1], mos[n2]);
|
||||||
micro_operation sw;
|
|
||||||
|
|
||||||
sw = mos[n1];
|
|
||||||
mos[n1] = mos[n2];
|
|
||||||
mos[n2] = sw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CALL_P (insn))
|
if (CALL_P (insn))
|
||||||
|
@ -6568,13 +6556,7 @@ add_with_sets (rtx_insn *insn, struct cselib_set *sets, int n_sets)
|
||||||
while (n1 < n2 && mos[n2].type != MO_VAL_USE)
|
while (n1 < n2 && mos[n2].type != MO_VAL_USE)
|
||||||
n2--;
|
n2--;
|
||||||
if (n1 < n2)
|
if (n1 < n2)
|
||||||
{
|
std::swap (mos[n1], mos[n2]);
|
||||||
micro_operation sw;
|
|
||||||
|
|
||||||
sw = mos[n1];
|
|
||||||
mos[n1] = mos[n2];
|
|
||||||
mos[n2] = sw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
n2 = VTI (bb)->mos.length () - 1;
|
n2 = VTI (bb)->mos.length () - 1;
|
||||||
|
@ -6585,13 +6567,7 @@ add_with_sets (rtx_insn *insn, struct cselib_set *sets, int n_sets)
|
||||||
while (n1 < n2 && mos[n2].type != MO_CLOBBER)
|
while (n1 < n2 && mos[n2].type != MO_CLOBBER)
|
||||||
n2--;
|
n2--;
|
||||||
if (n1 < n2)
|
if (n1 < n2)
|
||||||
{
|
std::swap (mos[n1], mos[n2]);
|
||||||
micro_operation sw;
|
|
||||||
|
|
||||||
sw = mos[n1];
|
|
||||||
mos[n1] = mos[n2];
|
|
||||||
mos[n2] = sw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6982,8 +6958,7 @@ vt_find_locations (void)
|
||||||
{
|
{
|
||||||
bb_heap_t *worklist = new bb_heap_t (LONG_MIN);
|
bb_heap_t *worklist = new bb_heap_t (LONG_MIN);
|
||||||
bb_heap_t *pending = new bb_heap_t (LONG_MIN);
|
bb_heap_t *pending = new bb_heap_t (LONG_MIN);
|
||||||
bb_heap_t *fibheap_swap = NULL;
|
sbitmap visited, in_worklist, in_pending;
|
||||||
sbitmap visited, in_worklist, in_pending, sbitmap_swap;
|
|
||||||
basic_block bb;
|
basic_block bb;
|
||||||
edge e;
|
edge e;
|
||||||
int *bb_order;
|
int *bb_order;
|
||||||
|
@ -7014,12 +6989,8 @@ vt_find_locations (void)
|
||||||
|
|
||||||
while (success && !pending->empty ())
|
while (success && !pending->empty ())
|
||||||
{
|
{
|
||||||
fibheap_swap = pending;
|
std::swap (worklist, pending);
|
||||||
pending = worklist;
|
std::swap (in_worklist, in_pending);
|
||||||
worklist = fibheap_swap;
|
|
||||||
sbitmap_swap = in_pending;
|
|
||||||
in_pending = in_worklist;
|
|
||||||
in_worklist = sbitmap_swap;
|
|
||||||
|
|
||||||
bitmap_clear (visited);
|
bitmap_clear (visited);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue