diff options
author | Michael Meissner <meissner@redhat.com> | 2000-06-04 02:03:03 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 2000-06-04 02:03:03 +0000 |
commit | 90280148a6f4613dd7d747c3e6bf1c9344c2de10 (patch) | |
tree | fd14eca2800c1070ec9806803dfc2f1ae1a25fb0 /gcc/ifcvt.c | |
parent | 7a50d89174fd0dfee1a44807234d3fce13a72f89 (diff) | |
download | gcc-90280148a6f4613dd7d747c3e6bf1c9344c2de10.tar.gz |
add IFCVT_MODIFY macros for the MD file to tweak the conditional execution support.
From-SVN: r34386
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r-- | gcc/ifcvt.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index eee72092afb..512983f5393 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -207,6 +207,7 @@ cond_exec_process_insns (start, end, test, prob_val, mod_ok) { int must_be_last = FALSE; rtx insn; + rtx pattern; for (insn = start; ; insn = NEXT_INSN (insn)) { @@ -239,9 +240,20 @@ cond_exec_process_insns (start, end, test, prob_val, mod_ok) } /* Now build the conditional form of the instruction. */ + pattern = PATTERN (insn); + + /* If the machine needs to modify the insn being conditionally executed, + say for example to force a constant integer operand into a temp + register, do so here. */ +#ifdef IFCVT_MODIFY_INSN + IFCVT_MODIFY_INSN (pattern, insn); + if (! pattern) + return FALSE; +#endif + validate_change (insn, &PATTERN (insn), gen_rtx_COND_EXEC (VOIDmode, copy_rtx (test), - PATTERN (insn)), 1); + pattern), 1); if (GET_CODE (insn) == CALL_INSN && prob_val) validate_change (insn, ®_NOTES (insn), @@ -369,6 +381,17 @@ cond_exec_process_if_block (test_bb, then_bb, else_bb, join_bb) GET_MODE (true_expr), XEXP (true_expr, 0), XEXP (true_expr, 1)); +#ifdef IFCVT_MODIFY_TESTS + /* If the machine description needs to modify the tests, such as setting a + conditional execution register from a comparison, it can do so here. */ + IFCVT_MODIFY_TESTS (true_expr, false_expr, test_bb, then_bb, else_bb, + join_bb); + + /* See if the conversion failed */ + if (!true_expr || !false_expr) + goto fail; +#endif + true_prob_val = find_reg_note (test_bb->end, REG_BR_PROB, NULL_RTX); if (true_prob_val) { @@ -398,6 +421,11 @@ cond_exec_process_if_block (test_bb, then_bb, else_bb, join_bb) if (! apply_change_group ()) return FALSE; +#ifdef IFCVT_MODIFY_FINAL + /* Do any machine dependent final modifications */ + IFCVT_MODIFY_FINAL (test_bb, then_bb, else_bb, join_bb); +#endif + /* Conversion succeeded. */ if (rtl_dump_file) fprintf (rtl_dump_file, "%d insn%s converted to conditional execution.\n", @@ -408,6 +436,11 @@ cond_exec_process_if_block (test_bb, then_bb, else_bb, join_bb) return TRUE; fail: +#ifdef IFCVT_MODIFY_CANCEL + /* Cancel any machine dependent changes. */ + IFCVT_MODIFY_CANCEL (test_bb, then_bb, else_bb, join_bb); +#endif + cancel_changes (0); return FALSE; } |