diff options
author | Richard Henderson <rth@cygnus.com> | 2000-04-07 02:24:45 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-04-07 02:24:45 -0700 |
commit | 0c99ec5c426117d4cd53e64e9ad4b22f3a903f36 (patch) | |
tree | a36fbb677db9b9d77dd79d4991fb6f4bd8349ebc /gcc/rtlanal.c | |
parent | 4c85a96d6e0a24baeeb64a13e1d522b5ee04d76f (diff) | |
download | gcc-0c99ec5c426117d4cd53e64e9ad4b22f3a903f36.zip gcc-0c99ec5c426117d4cd53e64e9ad4b22f3a903f36.tar.gz gcc-0c99ec5c426117d4cd53e64e9ad4b22f3a903f36.tar.bz2 |
rtl.def (COND_EXEC): New.
* rtl.def (COND_EXEC): New.
* rtl.h (COND_EXEC_TEST, COND_EXEC_CODE): New.
* tm.texi (MAX_CONDITIONAL_EXECUTE): Document.
* genconfig.c (have_cond_arith_flag): Remove.
(have_cond_exec_flag): New.
(walk_insn_part): Detect COND_EXEC, not arithmetic in IF_THEN_ELSE.
(main): Print HAVE_conditional_execution.
* haifa-sched.c (haifa_classify_insn): Recognize COND_EXEC.
(sched_analyze_insn, print_pattern): Likewise.
* reload.c (find_equiv_reg): Likewise.
* rtlanal.c (reg_referenced_p): Likewise.
(note_stores, dead_or_set_regno_p): Likewise.
(reg_overlap_mentioned_p): Rewrite to use a switch.
From-SVN: r32997
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 106 |
1 files changed, 66 insertions, 40 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index b44b992..d9087cd 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -429,6 +429,11 @@ reg_referenced_p (x, body) return 1; return 0; + case COND_EXEC: + if (reg_overlap_mentioned_p (x, COND_EXEC_TEST (body))) + return 1; + return reg_referenced_p (x, COND_EXEC_CODE (body)); + default: return 0; } @@ -949,52 +954,61 @@ reg_overlap_mentioned_p (x, in) /* If either argument is a constant, then modifying X can not affect IN. */ if (CONSTANT_P (x) || CONSTANT_P (in)) return 0; - else if (GET_CODE (x) == SUBREG) + + switch (GET_CODE (x)) { + case SUBREG: regno = REGNO (SUBREG_REG (x)); if (regno < FIRST_PSEUDO_REGISTER) regno += SUBREG_WORD (x); - } - else if (GET_CODE (x) == REG) - regno = REGNO (x); - else if (GET_CODE (x) == MEM) - { - const char *fmt; - int i; + goto do_reg; - if (GET_CODE (in) == MEM) - return 1; + case REG: + regno = REGNO (x); + do_reg: + endregno = regno + (regno < FIRST_PSEUDO_REGISTER + ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + return refers_to_regno_p (regno, endregno, in, NULL_PTR); - fmt = GET_RTX_FORMAT (GET_CODE (in)); + case MEM: + { + const char *fmt; + int i; - for (i = GET_RTX_LENGTH (GET_CODE (in)) - 1; i >= 0; i--) - if (fmt[i] == 'e' && reg_overlap_mentioned_p (x, XEXP (in, i))) + if (GET_CODE (in) == MEM) return 1; - return 0; - } - else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC - || GET_CODE (x) == CC0) - return reg_mentioned_p (x, in); - else if (GET_CODE (x) == PARALLEL - && GET_MODE (x) == BLKmode) - { - register int i; + fmt = GET_RTX_FORMAT (GET_CODE (in)); + for (i = GET_RTX_LENGTH (GET_CODE (in)) - 1; i >= 0; i--) + if (fmt[i] == 'e' && reg_overlap_mentioned_p (x, XEXP (in, i))) + return 1; - /* If any register in here refers to it - we return true. */ - for (i = XVECLEN (x, 0) - 1; i >= 0; i--) - if (reg_overlap_mentioned_p (SET_DEST (XVECEXP (x, 0, i)), in)) - return 1; - return 0; - } - else - abort (); + return 0; + } + + case SCRATCH: + case PC: + case CC0: + return reg_mentioned_p (x, in); - endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + case PARALLEL: + if (GET_MODE (x) == BLKmode) + { + register int i; - return refers_to_regno_p (regno, endregno, in, NULL_PTR); + /* If any register in here refers to it we return true. */ + for (i = XVECLEN (x, 0) - 1; i >= 0; i--) + if (reg_overlap_mentioned_p (SET_DEST (XVECEXP (x, 0, i)), in)) + return 1; + return 0; + } + break; + + default: + break; + } + + abort (); } /* Used for communications between the next few functions. */ @@ -1108,7 +1122,9 @@ note_stores (x, fun, data) void (*fun) PARAMS ((rtx, rtx, void *)); void *data; { - if ((GET_CODE (x) == SET || GET_CODE (x) == CLOBBER)) + if (GET_CODE (x) == COND_EXEC) + x = COND_EXEC_CODE (x); + if (GET_CODE (x) == SET || GET_CODE (x) == CLOBBER) { register rtx dest = SET_DEST (x); while ((GET_CODE (dest) == SUBREG @@ -1135,6 +1151,8 @@ note_stores (x, fun, data) for (i = XVECLEN (x, 0) - 1; i >= 0; i--) { register rtx y = XVECEXP (x, 0, i); + if (GET_CODE (y) == COND_EXEC) + y = COND_EXEC_CODE (y); if (GET_CODE (y) == SET || GET_CODE (y) == CLOBBER) { register rtx dest = SET_DEST (y); @@ -1213,7 +1231,7 @@ dead_or_set_regno_p (insn, test_regno) unsigned int test_regno; { unsigned int regno, endregno; - rtx link; + rtx link, pattern; /* See if there is a death note for something that includes TEST_REGNO. */ @@ -1236,7 +1254,12 @@ dead_or_set_regno_p (insn, test_regno) && find_regno_fusage (insn, CLOBBER, test_regno)) return 1; - if (GET_CODE (PATTERN (insn)) == SET) + pattern = PATTERN (insn); + + if (GET_CODE (pattern) == COND_EXEC) + pattern = COND_EXEC_CODE (pattern); + + if (GET_CODE (pattern) == SET) { rtx dest = SET_DEST (PATTERN (insn)); @@ -1259,13 +1282,16 @@ dead_or_set_regno_p (insn, test_regno) return (test_regno >= regno && test_regno < endregno); } - else if (GET_CODE (PATTERN (insn)) == PARALLEL) + else if (GET_CODE (pattern) == PARALLEL) { register int i; - for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--) + for (i = XVECLEN (pattern, 0) - 1; i >= 0; i--) { - rtx body = XVECEXP (PATTERN (insn), 0, i); + rtx body = XVECEXP (pattern, 0, i); + + if (GET_CODE (body) == COND_EXEC) + body = COND_EXEC_CODE (body); if (GET_CODE (body) == SET || GET_CODE (body) == CLOBBER) { |