From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1383) id 70E023858D35; Mon, 15 Jun 2020 19:23:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70E023858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592249006; bh=LxtJ5mHthyEb9ebi9mA0dVugaIX7YJEhYetgUgy+imE=; h=From:To:Subject:Date:From; b=DTRP26O/g0sxNU3eEaFq02a7m8VNWgcMHC3Qxv1S++S65LtkK25vI7Fo3AG4qdRgj d2wlAmVRBqQf4XfOcdgYtrXoYmwNY98gq7Re0ptlDkxN9TmnKi4JurcdZvp4qiwqWE i9KWe+tyrZy6JuhGuxxCMDGRbD5qFpEm81rhPhQY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Segher Boessenkool To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/segher/heads/cc0)] delete CC0_P X-Act-Checkin: gcc X-Git-Author: Segher Boessenkool X-Git-Refname: refs/users/segher/heads/cc0 X-Git-Oldrev: d38fec923b96efe80e7f46b2937a0f40adbc4ef7 X-Git-Newrev: 332578f6b4cb4a48d32e8842760ca7274a52f5bd Message-Id: <20200615192326.70E023858D35@sourceware.org> Date: Mon, 15 Jun 2020 19:23:26 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 19:23:26 -0000 https://gcc.gnu.org/g:332578f6b4cb4a48d32e8842760ca7274a52f5bd commit 332578f6b4cb4a48d32e8842760ca7274a52f5bd Author: Segher Boessenkool Date: Sun Sep 22 03:34:56 2019 +0000 delete CC0_P Diff: --- gcc/combine.c | 8 ++------ gcc/cprop.c | 21 +++++++-------------- gcc/genconfig.c | 12 ++---------- gcc/jump.c | 2 +- gcc/rtlanal.c | 4 ---- gcc/simplify-rtx.c | 5 ++--- 6 files changed, 14 insertions(+), 38 deletions(-) diff --git a/gcc/combine.c b/gcc/combine.c index f575dd3f47b..8a30e29b54e 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -6180,8 +6180,7 @@ combine_simplify_rtx (rtx x, machine_mode op0_mode, int in_dest, /* If the first operand is a condition code, we can't do anything with it. */ if (GET_CODE (XEXP (x, 0)) == COMPARE - || (GET_MODE_CLASS (GET_MODE (XEXP (x, 0))) != MODE_CC - && ! CC0_P (XEXP (x, 0)))) + || GET_MODE_CLASS (GET_MODE (XEXP (x, 0))) != MODE_CC) { rtx op0 = XEXP (x, 0); rtx op1 = XEXP (x, 1); @@ -6797,9 +6796,7 @@ simplify_set (rtx x) /* If we are setting CC0 or if the source is a COMPARE, look for the use of the comparison result and try to simplify it unless we already have used undobuf.other_insn. */ - if ((GET_MODE_CLASS (mode) == MODE_CC - || GET_CODE (src) == COMPARE - || CC0_P (dest)) + if ((GET_MODE_CLASS (mode) == MODE_CC || GET_CODE (src) == COMPARE) && (cc_use = find_single_use (dest, subst_insn, &other_insn)) != 0 && (undobuf.other_insn == 0 || other_insn == undobuf.other_insn) && COMPARISON_P (*cc_use) @@ -12168,7 +12165,6 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) /* We can't do anything if OP0 is a condition code value, rather than an actual data value. */ if (const_op != 0 - || CC0_P (XEXP (op0, 0)) || GET_MODE_CLASS (GET_MODE (XEXP (op0, 0))) == MODE_CC) break; diff --git a/gcc/cprop.c b/gcc/cprop.c index 169ca804e33..d9fd0525702 100644 --- a/gcc/cprop.c +++ b/gcc/cprop.c @@ -963,10 +963,6 @@ cprop_jump (basic_block bb, rtx_insn *setcc, rtx_insn *jump, rtx from, rtx src) remove_note (jump, note); } - /* Delete the cc0 setter. */ - if (HAVE_cc0 && setcc != NULL && CC0_P (SET_DEST (single_set (setcc)))) - delete_insn (setcc); - global_const_prop_count++; if (dump_file != NULL) { @@ -1008,14 +1004,14 @@ constprop_register (rtx from, rtx src, rtx_insn *insn) { rtx sset; - /* Check for reg or cc0 setting instructions followed by - conditional branch instructions first. */ + /* Check for reg setting instructions followed by conditional branch + instructions first. */ if ((sset = single_set (insn)) != NULL && NEXT_INSN (insn) && any_condjump_p (NEXT_INSN (insn)) && onlyjump_p (NEXT_INSN (insn))) { rtx dest = SET_DEST (sset); - if ((REG_P (dest) || CC0_P (dest)) + if (REG_P (dest) && cprop_jump (BLOCK_FOR_INSN (insn), insn, NEXT_INSN (insn), from, src)) return 1; @@ -1634,8 +1630,7 @@ bypass_block (basic_block bb, rtx_insn *setcc, rtx_insn *jump) /* Avoid unification of the edge with other edges from original branch. We would end up emitting the instruction on "both" edges. */ - if (dest && setcc && !CC0_P (SET_DEST (PATTERN (setcc))) - && find_edge (e->src, dest)) + if (dest && setcc && find_edge (e->src, dest)) dest = NULL; old_dest = e->dest; @@ -1645,13 +1640,11 @@ bypass_block (basic_block bb, rtx_insn *setcc, rtx_insn *jump) { redirect_edge_and_branch_force (e, dest); - /* Copy the register setter to the redirected edge. - Don't copy CC0 setters, as CC0 is dead after jump. */ + /* Copy the register setter to the redirected edge. */ if (setcc) { rtx pat = PATTERN (setcc); - if (!CC0_P (SET_DEST (pat))) - insert_insn_on_edge (copy_insn (pat), e); + insert_insn_on_edge (copy_insn (pat), e); } if (dump_file != NULL) @@ -1717,7 +1710,7 @@ bypass_conditional_jumps (void) break; dest = SET_DEST (PATTERN (insn)); - if (REG_P (dest) || CC0_P (dest)) + if (REG_P (dest)) setcc = insn; else break; diff --git a/gcc/genconfig.c b/gcc/genconfig.c index 5a95676a312..b1abebf0585 100644 --- a/gcc/genconfig.c +++ b/gcc/genconfig.c @@ -330,17 +330,9 @@ main (int argc, const char **argv) printf ("#endif\n"); if (have_cc0_flag) - { - printf ("#define HAVE_cc0 1\n"); - printf ("#define CC0_P(X) ((X) == cc0_rtx)\n"); - } + printf ("#define HAVE_cc0 1\n"); else - { - /* We output CC0_P this way to make sure that X is declared - somewhere. */ - printf ("#define HAVE_cc0 0\n"); - printf ("#define CC0_P(X) ((X) ? 0 : 0)\n"); - } + printf ("#define HAVE_cc0 0\n"); if (have_cmove_flag) printf ("#define HAVE_conditional_move 1\n"); diff --git a/gcc/jump.c b/gcc/jump.c index b36b9894f2e..b6469031904 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -400,7 +400,7 @@ reversed_comparison_code_parts (enum rtx_code code, const_rtx arg0, break; } - if (GET_MODE_CLASS (mode) == MODE_CC || CC0_P (arg0)) + if (GET_MODE_CLASS (mode) == MODE_CC) { /* Try to search for the comparison to determine the real mode. This code is expensive, but with sane machine description it diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 94c1f669e1b..93170a4394e 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -5728,10 +5728,6 @@ canonicalize_condition (rtx_insn *insn, rtx cond, int reverse, } } - /* Never return CC0; return zero instead. */ - if (CC0_P (op0)) - return 0; - /* We promised to return a comparison. */ rtx ret = gen_rtx_fmt_ee (code, VOIDmode, op0, op1); if (COMPARISON_P (ret)) diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 28c2dc69ae7..a92eb2ee4e9 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -5130,8 +5130,7 @@ simplify_relational_operation (enum rtx_code code, machine_mode mode, return simplify_gen_relational (code, mode, VOIDmode, XEXP (op0, 0), XEXP (op0, 1)); - if (GET_MODE_CLASS (cmp_mode) == MODE_CC - || CC0_P (op0)) + if (GET_MODE_CLASS (cmp_mode) == MODE_CC) return NULL_RTX; trueop0 = avoid_constant_pool_reference (op0); @@ -5496,7 +5495,7 @@ simplify_const_relational_operation (enum rtx_code code, /* We can't simplify MODE_CC values since we don't know what the actual comparison is. */ - if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_CC || CC0_P (op0)) + if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_CC) return 0; /* Make sure the constant is second. */