dojump.h (do_jump): Delete.

* dojump.h (do_jump): Delete.
	(do_jump_1): Likewise.
	(split_comparison): Move around.
	* dojump.c (do_jump): Make static.
	(do_jump_1): Likewise.
	(jumpifnot): Move around.
	(jumpifnot_1): Likewise.
	(jumpif): Likewise.
	(jumpif_1): Likewise.
	* expr.c (expand_expr_real_1): Call jumpif[not] instead of do_jump.

From-SVN: r264781
This commit is contained in:
Eric Botcazou 2018-10-02 10:55:33 +00:00 committed by Eric Botcazou
parent 5d11b4bf36
commit be099f3724
4 changed files with 66 additions and 52 deletions

View File

@ -1,3 +1,16 @@
2018-10-02 Eric Botcazou <ebotcazou@adacore.com>
* dojump.h (do_jump): Delete.
(do_jump_1): Likewise.
(split_comparison): Move around.
* dojump.c (do_jump): Make static.
(do_jump_1): Likewise.
(jumpifnot): Move around.
(jumpifnot_1): Likewise.
(jumpif): Likewise.
(jumpif_1): Likewise.
* expr.c (expand_expr_real_1): Call jumpif[not] instead of do_jump.
2018-10-02 Eric Botcazou <ebotcazou@adacore.com>
* reorg.c (make_return_insns): Use emit_copy_of_insn_after for the

View File

@ -38,6 +38,8 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
static bool prefer_and_bit_test (scalar_int_mode, int);
static void do_jump (tree, rtx_code_label *, rtx_code_label *,
profile_probability);
static void do_jump_by_parts_greater (scalar_int_mode, tree, tree, int,
rtx_code_label *, rtx_code_label *,
profile_probability);
@ -118,38 +120,6 @@ restore_pending_stack_adjust (saved_pending_stack_adjust *save)
}
}
/* Expand conditional expressions. */
/* Generate code to evaluate EXP and jump to LABEL if the value is zero. */
void
jumpifnot (tree exp, rtx_code_label *label, profile_probability prob)
{
do_jump (exp, label, NULL, prob.invert ());
}
void
jumpifnot_1 (enum tree_code code, tree op0, tree op1, rtx_code_label *label,
profile_probability prob)
{
do_jump_1 (code, op0, op1, label, NULL, prob.invert ());
}
/* Generate code to evaluate EXP and jump to LABEL if the value is nonzero. */
void
jumpif (tree exp, rtx_code_label *label, profile_probability prob)
{
do_jump (exp, NULL, label, prob);
}
void
jumpif_1 (enum tree_code code, tree op0, tree op1,
rtx_code_label *label, profile_probability prob)
{
do_jump_1 (code, op0, op1, NULL, label, prob);
}
/* Used internally by prefer_and_bit_test. */
static GTY(()) rtx and_reg;
@ -197,7 +167,7 @@ prefer_and_bit_test (scalar_int_mode mode, int bitnum)
OP0 CODE OP1 . IF_FALSE_LABEL and IF_TRUE_LABEL like in do_jump.
PROB is probability of jump to if_true_label. */
void
static void
do_jump_1 (enum tree_code code, tree op0, tree op1,
rtx_code_label *if_false_label, rtx_code_label *if_true_label,
profile_probability prob)
@ -417,7 +387,7 @@ do_jump_1 (enum tree_code code, tree op0, tree op1,
PROB is probability of jump to if_true_label. */
void
static void
do_jump (tree exp, rtx_code_label *if_false_label,
rtx_code_label *if_true_label, profile_probability prob)
{
@ -946,6 +916,43 @@ split_comparison (enum rtx_code code, machine_mode mode,
}
}
/* Generate code to evaluate EXP and jump to LABEL if the value is nonzero.
PROB is probability of jump to LABEL. */
void
jumpif (tree exp, rtx_code_label *label, profile_probability prob)
{
do_jump (exp, NULL, label, prob);
}
/* Similar to jumpif but dealing with exploded comparisons of the type
OP0 CODE OP1 . LABEL and PROB are like in jumpif. */
void
jumpif_1 (enum tree_code code, tree op0, tree op1, rtx_code_label *label,
profile_probability prob)
{
do_jump_1 (code, op0, op1, NULL, label, prob);
}
/* Generate code to evaluate EXP and jump to LABEL if the value is zero.
PROB is probability of jump to LABEL. */
void
jumpifnot (tree exp, rtx_code_label *label, profile_probability prob)
{
do_jump (exp, label, NULL, prob.invert ());
}
/* Similar to jumpifnot but dealing with exploded comparisons of the type
OP0 CODE OP1 . LABEL and PROB are like in jumpifnot. */
void
jumpifnot_1 (enum tree_code code, tree op0, tree op1, rtx_code_label *label,
profile_probability prob)
{
do_jump_1 (code, op0, op1, label, NULL, prob.invert ());
}
/* Like do_compare_and_jump but expects the values to compare as two rtx's.
The decision as to signed or unsigned comparison must be made by the caller.

View File

@ -56,29 +56,22 @@ extern void save_pending_stack_adjust (saved_pending_stack_adjust *);
extern void restore_pending_stack_adjust (saved_pending_stack_adjust *);
/* Generate code to evaluate EXP and jump to LABEL if the value is zero. */
extern void jumpifnot (tree exp, rtx_code_label *label,
profile_probability prob);
extern void jumpifnot_1 (enum tree_code, tree, tree, rtx_code_label *,
profile_probability);
extern bool split_comparison (enum rtx_code, machine_mode,
enum rtx_code *, enum rtx_code *);
/* Generate code to evaluate EXP and jump to LABEL if the value is nonzero. */
extern void jumpif (tree exp, rtx_code_label *label, profile_probability prob);
extern void jumpif_1 (enum tree_code, tree, tree, rtx_code_label *,
profile_probability);
/* Generate code to evaluate EXP and jump to IF_FALSE_LABEL if
the result is zero, or IF_TRUE_LABEL if the result is one. */
extern void do_jump (tree exp, rtx_code_label *if_false_label,
rtx_code_label *if_true_label, profile_probability prob);
extern void do_jump_1 (enum tree_code, tree, tree, rtx_code_label *,
rtx_code_label *, profile_probability);
/* Generate code to evaluate EXP and jump to LABEL if the value is zero. */
extern void jumpifnot (tree exp, rtx_code_label *label,
profile_probability prob);
extern void jumpifnot_1 (enum tree_code, tree, tree, rtx_code_label *,
profile_probability);
extern void do_compare_rtx_and_jump (rtx, rtx, enum rtx_code, int,
machine_mode, rtx, rtx_code_label *,
rtx_code_label *, profile_probability);
extern bool split_comparison (enum rtx_code, machine_mode,
enum rtx_code *, enum rtx_code *);
#endif /* GCC_DOJUMP_H */

View File

@ -11155,10 +11155,11 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
{
rtx_code_label *label = gen_label_rtx ();
int value = TREE_CODE (rhs) == BIT_IOR_EXPR;
do_jump (TREE_OPERAND (rhs, 1),
value ? label : 0,
value ? 0 : label,
profile_probability::uninitialized ());
profile_probability prob = profile_probability::uninitialized ();
if (value)
jumpifnot (TREE_OPERAND (rhs, 1), label, prob);
else
jumpif (TREE_OPERAND (rhs, 1), label, prob);
expand_assignment (lhs, build_int_cst (TREE_TYPE (rhs), value),
false);
do_pending_stack_adjust ();