#include "toplev.h"
#include "hard-reg-set.h"
#include "rtl.h"
-#include "hash-set.h"
-#include "machmode.h"
-#include "vec.h"
-#include "double-int.h"
-#include "input.h"
#include "alias.h"
#include "symtab.h"
-#include "wide-int.h"
-#include "inchash.h"
#include "tree.h"
#include "tm_p.h"
#include "regs.h"
#include "lcm.h"
#include "cfgcleanup.h"
#include "basic-block.h"
-#include "hashtab.h"
-#include "statistics.h"
-#include "real.h"
-#include "fixed-value.h"
#include "expmed.h"
#include "dojump.h"
#include "explow.h"
#include "stmt.h"
#include "expr.h"
#include "except.h"
-#include "ggc.h"
#include "params.h"
+#include "alloc-pool.h"
#include "cselib.h"
#include "intl.h"
#include "obstack.h"
#include "tree-pass.h"
-#include "hash-table.h"
#include "df.h"
#include "dbgcnt.h"
#include "target.h"
/* Head of the list of load/store memory refs. */
static struct ls_expr * pre_ldst_mems = NULL;
-struct pre_ldst_expr_hasher : typed_noop_remove <ls_expr>
+struct pre_ldst_expr_hasher : nofree_ptr_hash <ls_expr>
{
- typedef ls_expr *value_type;
typedef value_type compare_type;
static inline hashval_t hash (const ls_expr *);
static inline bool equal (const ls_expr *, const ls_expr *);
static void insert_expr_in_table (rtx, machine_mode, rtx_insn *, int, int,
int, struct gcse_hash_table_d *);
static unsigned int hash_expr (const_rtx, machine_mode, int *, int);
-static void record_last_reg_set_info (rtx, int);
+static void record_last_reg_set_info (rtx_insn *, int);
static void record_last_mem_set_info (rtx_insn *);
static void record_last_set_info (rtx, const_rtx, void *);
static void compute_hash_table (struct gcse_hash_table_d *);
static int pre_delete (void);
static int pre_gcse (struct edge_list *);
static int one_pre_gcse_pass (void);
-static void add_label_notes (rtx, rtx);
+static void add_label_notes (rtx, rtx_insn *);
static void alloc_code_hoist_mem (int, int);
static void free_code_hoist_mem (void);
static void compute_code_hoist_vbeinout (void);
static void update_ld_motion_stores (struct gcse_expr *);
static void clear_modify_mem_tables (void);
static void free_modify_mem_tables (void);
-static rtx gcse_emit_move_after (rtx, rtx, rtx_insn *);
static bool is_too_expensive (const char *);
#define GNEW(T) ((T *) gmalloc (sizeof (T)))
{
int i;
#ifndef AVOID_CCMODE_COPIES
- rtx reg, insn;
+ rtx reg;
+ rtx_insn *insn;
#endif
memset (can_copy, 0, NUM_MACHINE_MODES);
can_copy[i] = 0;
#else
reg = gen_rtx_REG ((machine_mode) i, LAST_VIRTUAL_REGISTER + 1);
- insn = emit_insn (gen_rtx_SET (VOIDmode, reg, reg));
+ insn = emit_insn (gen_rtx_SET (reg, reg));
if (recog (PATTERN (insn), insn, NULL) >= 0)
can_copy[i] = 1;
#endif
if (test_insn == 0)
{
test_insn
- = make_insn_raw (gen_rtx_SET (VOIDmode,
- gen_rtx_REG (word_mode,
+ = make_insn_raw (gen_rtx_SET (gen_rtx_REG (word_mode,
FIRST_PSEUDO_REGISTER * 2),
const0_rtx));
SET_NEXT_INSN (test_insn) = SET_PREV_INSN (test_insn) = 0;
&& REG_NOTE_KIND (note) == REG_EQUAL
&& !REG_P (src)
&& want_to_gcse_p (XEXP (note, 0), NULL))
- src = XEXP (note, 0), set = gen_rtx_SET (VOIDmode, dest, src);
+ src = XEXP (note, 0), set = gen_rtx_SET (dest, src);
/* Only record sets of pseudo-regs in the hash table. */
if (regno >= FIRST_PSEUDO_REGISTER
valid, as a quick test to invalidate them. */
static void
-record_last_reg_set_info (rtx insn, int regno)
+record_last_reg_set_info (rtx_insn *insn, int regno)
{
struct reg_avail_info *info = ®_avail_info[regno];
int luid = DF_INSN_LUID (insn);
insn will be recognized (this also adds any needed CLOBBERs). */
else
{
- rtx_insn *insn = emit_insn (gen_rtx_SET (VOIDmode, reg, exp));
+ rtx_insn *insn = emit_insn (gen_rtx_SET (reg, exp));
if (insn_invalid_p (insn, false))
gcc_unreachable ();
int regno = REGNO (reg);
int indx = expr->bitmap_index;
rtx pat = PATTERN (insn);
- rtx set, first_set, new_insn;
+ rtx set, first_set;
+ rtx_insn *new_insn;
rtx old_reg;
int i;
/* Emit move from SRC to DEST noting the equivalence with expression computed
in INSN. */
-static rtx
+static rtx_insn *
gcse_emit_move_after (rtx dest, rtx src, rtx_insn *insn)
{
rtx_insn *new_rtx;
necessary REG_LABEL_OPERAND and REG_LABEL_TARGET notes. */
static void
-add_label_notes (rtx x, rtx insn)
+add_label_notes (rtx x, rtx_insn *insn)
{
enum rtx_code code = GET_CODE (x);
int i, j;
rtx pat = PATTERN (insn);
rtx src = SET_SRC (pat);
rtx reg = expr->reaching_reg;
- rtx copy;
/* If we've already copied it, continue. */
if (expr->reaching_reg == src)
fprintf (dump_file, "\n");
}
- copy = gen_move_insn (reg, copy_rtx (SET_SRC (pat)));
+ rtx_insn *copy = gen_move_insn (reg, copy_rtx (SET_SRC (pat)));
emit_insn_before (copy, insn);
SET_SRC (pat) = reg;
df_insn_rescan (insn);