From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1383) id 3C0DC3844046; Tue, 15 Dec 2020 17:04:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C0DC3844046 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: 07ffc51d8aba5f24a0095a2c3eb2f7f188f2055a X-Git-Newrev: 5cce0f7e03d0b07fabdc0945a7a638c4ba6da525 Message-Id: <20201215170413.3C0DC3844046@sourceware.org> Date: Tue, 15 Dec 2020 17:04:13 +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: Tue, 15 Dec 2020 17:04:13 -0000 https://gcc.gnu.org/g:5cce0f7e03d0b07fabdc0945a7a638c4ba6da525 commit 5cce0f7e03d0b07fabdc0945a7a638c4ba6da525 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 e81a3d18dc2..735f4b937b7 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -6181,8 +6181,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); @@ -6798,9 +6797,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) @@ -12190,7 +12187,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 e6ea74960a3..26317546030 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 a76e7c54704..00aaa38996b 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 47e7aebda8a..4cedfbb05a3 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -5302,8 +5302,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); @@ -5668,7 +5667,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. */