Commit 3bdf0b64 by Eric Botcazou Committed by Eric Botcazou

trans.c (Regular_Loop_to_gnu): Replace tests on individual flag_unswitch_loops…

trans.c (Regular_Loop_to_gnu): Replace tests on individual flag_unswitch_loops and flag_tree_loop_vectorize...

	* gcc-interface/trans.c (Regular_Loop_to_gnu): Replace tests on
	individual flag_unswitch_loops and flag_tree_loop_vectorize switches
	with test on global optimize switch.
	(Raise_Error_to_gnu): Likewise.

From-SVN: r268671
parent 89cfdb7e
2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Regular_Loop_to_gnu): Replace tests on
individual flag_unswitch_loops and flag_tree_loop_vectorize switches
with test on global optimize switch.
(Raise_Error_to_gnu): Likewise.
2019-02-07 Eric Botcazou <ebotcazou@adacore.com> 2019-02-07 Eric Botcazou <ebotcazou@adacore.com>
* libgnarl/s-linux__sparc.ads (ETIMEDOUT): Set to correct value. * libgnarl/s-linux__sparc.ads (ETIMEDOUT): Set to correct value.
......
...@@ -3787,7 +3787,7 @@ Regular_Loop_to_gnu (Node_Id gnat_node, tree *gnu_cond_expr_p) ...@@ -3787,7 +3787,7 @@ Regular_Loop_to_gnu (Node_Id gnat_node, tree *gnu_cond_expr_p)
unswitching is enabled, do not require the loop bounds to be also unswitching is enabled, do not require the loop bounds to be also
invariant, as their evaluation will still be ahead of the loop. */ invariant, as their evaluation will still be ahead of the loop. */
if (vec_safe_length (gnu_loop_info->checks) > 0 if (vec_safe_length (gnu_loop_info->checks) > 0
&& (make_invariant (&gnu_low, &gnu_high) || flag_unswitch_loops)) && (make_invariant (&gnu_low, &gnu_high) || optimize >= 3))
{ {
struct range_check_info_d *rci; struct range_check_info_d *rci;
unsigned int i, n_remaining_checks = 0; unsigned int i, n_remaining_checks = 0;
...@@ -3840,22 +3840,21 @@ Regular_Loop_to_gnu (Node_Id gnat_node, tree *gnu_cond_expr_p) ...@@ -3840,22 +3840,21 @@ Regular_Loop_to_gnu (Node_Id gnat_node, tree *gnu_cond_expr_p)
/* Note that loop unswitching can only be applied a small number of /* Note that loop unswitching can only be applied a small number of
times to a given loop (PARAM_MAX_UNSWITCH_LEVEL default to 3). */ times to a given loop (PARAM_MAX_UNSWITCH_LEVEL default to 3). */
if (IN_RANGE (n_remaining_checks, 1, 3) if (IN_RANGE (n_remaining_checks, 1, 3)
&& optimize > 1 && optimize >= 2
&& !optimize_size) && !optimize_size)
FOR_EACH_VEC_ELT (*gnu_loop_info->checks, i, rci) FOR_EACH_VEC_ELT (*gnu_loop_info->checks, i, rci)
if (rci->invariant_cond != boolean_false_node) if (rci->invariant_cond != boolean_false_node)
{ {
TREE_OPERAND (rci->inserted_cond, 0) = rci->invariant_cond; TREE_OPERAND (rci->inserted_cond, 0) = rci->invariant_cond;
if (flag_unswitch_loops) if (optimize >= 3)
add_stmt_with_node_force (rci->inserted_cond, gnat_node); add_stmt_with_node_force (rci->inserted_cond, gnat_node);
} }
} }
/* Second, if loop vectorization is enabled and the iterations of the /* Second, if loop vectorization is enabled and the iterations of the
loop can easily be proved as independent, mark the loop. */ loop can easily be proved as independent, mark the loop. */
if (optimize if (optimize >= 3
&& flag_tree_loop_vectorize
&& independent_iterations_p (LOOP_STMT_BODY (gnu_loop_stmt))) && independent_iterations_p (LOOP_STMT_BODY (gnu_loop_stmt)))
LOOP_STMT_IVDEP (gnu_loop_stmt) = 1; LOOP_STMT_IVDEP (gnu_loop_stmt) = 1;
...@@ -6478,7 +6477,7 @@ Raise_Error_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) ...@@ -6478,7 +6477,7 @@ Raise_Error_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
= build1 (SAVE_EXPR, boolean_type_node, boolean_true_node); = build1 (SAVE_EXPR, boolean_type_node, boolean_true_node);
vec_safe_push (loop->checks, rci); vec_safe_push (loop->checks, rci);
gnu_cond = build_noreturn_cond (gnat_to_gnu (gnat_cond)); gnu_cond = build_noreturn_cond (gnat_to_gnu (gnat_cond));
if (flag_unswitch_loops) if (optimize >= 3)
gnu_cond = build_binary_op (TRUTH_ANDIF_EXPR, gnu_cond = build_binary_op (TRUTH_ANDIF_EXPR,
boolean_type_node, boolean_type_node,
rci->inserted_cond, rci->inserted_cond,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment