summaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-25 12:04:17 +0000
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-25 12:04:17 +0000
commitd263732c915b08ccfb5ef155ed27a8671760dc91 (patch)
tree0fecbc9fb7d6fe74247aea9809ba392638ca87c6 /gcc/cse.c
parent25715f21635867d814cee580670af40bb5185be9 (diff)
downloadgcc-d263732c915b08ccfb5ef155ed27a8671760dc91.tar.gz
2004-05-25 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (OBJS): Add rtlhooks.o. (rtlanal.o): Depend on function.h. (cse.o): Depend on rtlhooks-def.h. (combine.o): Depend on rtlhooks-def.h. (rtlhooks.o): New rule. * combine.c: Include rtlhooks-def.h. (nonzero_bits, cached_nonzero_bits, nonzero_bits1, num_sign_bit_copies, cached_num_sign_bit_copies, num_sign_bit_copies1): Move most of the code to rtlanal.c. (reg_nonzero_bits_for_combine, reg_num_sign_bit_copies_for_combine): New functions holding the remnants of the above. (combine_rtl_hooks): New. (combine_instructions): Set rtl_hooks instead of gen_lowpart. * cse.c: Include rtlhooks-def.h. (cse_rtl_hooks): New. (cse_main): Set rtl_hooks instead of gen_lowpart. * emit-rtl.c (gen_lowpart): Remove. (gen_lowpart_general): Move to rtlhooks.c. * rtl.h (nonzero_bits, num_sign_bit_copies, struct rtl_hooks, rtl_hooks, general_rtl_hooks): New. (gen_lowpart_general): Remove. (gen_lowpart): Temporarily redefine as a macro. * rtlanal.c: Include function.h. (nonzero_bits, cached_nonzero_bits, nonzero_bits1, num_sign_bit_copies, cached_num_sign_bit_copies, num_sign_bit_copies1): New, from combine.c. * rtlhooks.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82234 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 6d3c53f7635..5f1107c3e22 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -43,6 +43,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "except.h"
#include "target.h"
#include "params.h"
+#include "rtlhooks-def.h"
/* The basic idea of common subexpression elimination is to go
through the code, keeping a record of expressions that would
@@ -664,6 +665,12 @@ static int cse_change_cc_mode (rtx *, void *);
static void cse_change_cc_mode_insns (rtx, rtx, rtx);
static enum machine_mode cse_cc_succs (basic_block, rtx, rtx, bool);
+
+#undef RTL_HOOKS_GEN_LOWPART
+#define RTL_HOOKS_GEN_LOWPART gen_lowpart_if_possible
+
+static const struct rtl_hooks cse_rtl_hooks = RTL_HOOKS_INITIALIZER;
+
/* Nonzero if X has the form (PLUS frame-pointer integer). We check for
virtual regs here because the simplify_*_operation routines are called
by integrate.c, which is called before virtual register instantiation. */
@@ -6881,7 +6888,7 @@ cse_main (rtx f, int nregs, int after_loop, FILE *file)
constant_pool_entries_cost = 0;
constant_pool_entries_regcost = 0;
val.path_size = 0;
- gen_lowpart = gen_lowpart_if_possible;
+ rtl_hooks = cse_rtl_hooks;
init_recog ();
init_alias_analysis ();
@@ -7001,7 +7008,7 @@ cse_main (rtx f, int nregs, int after_loop, FILE *file)
free (uid_cuid);
free (reg_eqv_table);
free (val.path);
- gen_lowpart = gen_lowpart_general;
+ rtl_hooks = general_rtl_hooks;
return cse_jumps_altered || recorded_label_ref;
}