summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-24 17:59:31 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-24 17:59:31 +0000
commitdcfaf3931605e637f363c7a33ed5cc24c802b7ca (patch)
treed8caf60a281b6b6a8b3d42c1eb6e78fbcd77509c
parentea368aac06c9318be604f6a9964cf4f7c50ec296 (diff)
downloadgcc-dcfaf3931605e637f363c7a33ed5cc24c802b7ca.tar.gz
gcc/
* ifcvt.c (HAVE_incscc, HAVE_decscc, HAVE_cbranchcc4): Delete. (have_cbranchcc4): New variable. (cc_in_cond, noce_emit_cmove, noce_get_alt_condition) (noce_get_condition): Use it instead of HAVE_cbranchcc4. (if_convert): Initialize have_cbranchcc4. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227142 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/ifcvt.c24
2 files changed, 17 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2fcad497751..7ef1166c145 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2015-08-24 Richard Sandiford <richard.sandiford@arm.com>
+ * ifcvt.c (HAVE_incscc, HAVE_decscc, HAVE_cbranchcc4): Delete.
+ (have_cbranchcc4): New variable.
+ (cc_in_cond, noce_emit_cmove, noce_get_alt_condition)
+ (noce_get_condition): Use it instead of HAVE_cbranchcc4.
+ (if_convert): Initialize have_cbranchcc4.
+
+2015-08-24 Richard Sandiford <richard.sandiford@arm.com>
+
* builtins.c (expand_cmpstrn): Rename to...
(expand_cmpstrn_or_cmpmem): ...this.
(expand_builtin_strcmp, expand_builtin_strncmp): Update accordingly.
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index a46efec6059..5cf1721fcfa 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -55,23 +55,12 @@
#include "shrink-wrap.h"
#include "ifcvt.h"
-#ifndef HAVE_incscc
-#define HAVE_incscc 0
-#endif
-#ifndef HAVE_decscc
-#define HAVE_decscc 0
-#endif
-
#ifndef MAX_CONDITIONAL_EXECUTE
#define MAX_CONDITIONAL_EXECUTE \
(BRANCH_COST (optimize_function_for_speed_p (cfun), false) \
+ 1)
#endif
-#ifndef HAVE_cbranchcc4
-#define HAVE_cbranchcc4 0
-#endif
-
#define IFCVT_MULTIPLE_DUMPS 1
#define NULL_BLOCK ((basic_block) NULL)
@@ -79,6 +68,9 @@
/* True if after combine pass. */
static bool ifcvt_after_combine;
+/* True if the target has the cbranchcc4 optab. */
+static bool have_cbranchcc4;
+
/* # of IF-THEN or IF-THEN-ELSE blocks we looked at */
static int num_possible_if_blocks;
@@ -1014,7 +1006,7 @@ noce_emit_move_insn (rtx x, rtx y)
static rtx
cc_in_cond (rtx cond)
{
- if (HAVE_cbranchcc4 && cond
+ if (have_cbranchcc4 && cond
&& GET_MODE_CLASS (GET_MODE (XEXP (cond, 0))) == MODE_CC)
return XEXP (cond, 0);
@@ -1557,7 +1549,7 @@ noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code,
if (! general_operand (cmp_a, GET_MODE (cmp_a))
|| ! general_operand (cmp_b, GET_MODE (cmp_b)))
{
- if (!(HAVE_cbranchcc4)
+ if (!have_cbranchcc4
|| GET_MODE_CLASS (GET_MODE (cmp_a)) != MODE_CC
|| cmp_b != const0_rtx)
return NULL_RTX;
@@ -2052,7 +2044,7 @@ noce_get_alt_condition (struct noce_if_info *if_info, rtx target,
}
cond = canonicalize_condition (if_info->jump, cond, reverse,
- earliest, target, HAVE_cbranchcc4, true);
+ earliest, target, have_cbranchcc4, true);
if (! cond || ! reg_mentioned_p (target, cond))
return NULL;
@@ -2544,7 +2536,7 @@ noce_get_condition (rtx_insn *jump, rtx_insn **earliest, bool then_else_reversed
/* Otherwise, fall back on canonicalize_condition to do the dirty
work of manipulating MODE_CC values and COMPARE rtx codes. */
tmp = canonicalize_condition (jump, cond, reverse, earliest,
- NULL_RTX, HAVE_cbranchcc4, true);
+ NULL_RTX, have_cbranchcc4, true);
/* We don't handle side-effects in the condition, like handling
REG_INC notes and making sure no duplicate conditions are emitted. */
@@ -4645,6 +4637,8 @@ if_convert (bool after_combine)
/* Record whether we are after combine pass. */
ifcvt_after_combine = after_combine;
+ have_cbranchcc4 = (direct_optab_handler (cbranch_optab, CCmode)
+ != CODE_FOR_nothing);
num_possible_if_blocks = 0;
num_updated_if_blocks = 0;
num_true_changes = 0;