$(TM_P_H) $(CFGLOOP_H) $(EMIT_RTL_H) domwalk.h
web.o : web.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) \
- $(DF_H) $(OBSTACK_H) $(TIMEVAR_H) $(TREE_PASS_H)
+ insn-config.h $(RECOG_H) $(DF_H) $(OBSTACK_H) $(TIMEVAR_H) $(TREE_PASS_H)
gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h $(GGC_H) \
$(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) \
#include "output.h"
#include "df.h"
#include "function.h"
+#include "insn-config.h"
+#include "recog.h"
#include "timevar.h"
#include "tree-pass.h"
return false;
}
+/* For INSN, union all defs and uses that are linked by match_dup.
+ FUN is the function that does the union. */
+
+static void
+union_match_dups (rtx insn, struct web_entry *def_entry,
+ struct web_entry *use_entry,
+ bool (*fun) (struct web_entry *, struct web_entry *))
+{
+ struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
+ df_ref *use_link = DF_INSN_INFO_USES (insn_info);
+ df_ref *def_link = DF_INSN_INFO_DEFS (insn_info);
+ int i;
+
+ extract_insn (insn);
+
+ for (i = 0; i < recog_data.n_dups; i++)
+ {
+ int op = recog_data.dup_num[i];
+ enum op_type type = recog_data.operand_type[op];
+ df_ref *ref, *dupref;
+ struct web_entry *entry;
+
+ for (dupref = use_link; *dupref; dupref++)
+ if (DF_REF_LOC (*dupref) == recog_data.dup_loc[i])
+ break;
+
+ if (*dupref == NULL
+ || DF_REF_REGNO (*dupref) < FIRST_PSEUDO_REGISTER)
+ continue;
+
+ ref = type == OP_IN ? use_link : def_link;
+ entry = type == OP_IN ? use_entry : def_entry;
+ for (; *ref; ref++)
+ if (DF_REF_LOC (*ref) == recog_data.operand_loc[op])
+ break;
+
+ (*fun) (use_entry + DF_REF_ID (*dupref), entry + DF_REF_ID (*ref));
+ }
+}
+
/* For each use, all possible defs reaching it must come in the same
register, union them.
FUN is the function that does the union.
{
struct df_insn_info *insn_info = DF_REF_INSN_INFO (use);
struct df_link *link = DF_REF_CHAIN (use);
- df_ref *use_link;
df_ref *eq_use_link;
df_ref *def_link;
rtx set;
if (insn_info)
{
rtx insn = insn_info->insn;
- use_link = DF_INSN_INFO_USES (insn_info);
eq_use_link = DF_INSN_INFO_EQ_USES (insn_info);
def_link = DF_INSN_INFO_DEFS (insn_info);
set = single_set (insn);
else
{
/* An artificial use. It links up with nothing. */
- use_link = NULL;
eq_use_link = NULL;
def_link = NULL;
set = NULL;
}
- /* Some instructions may use match_dup for their operands. In case the
- operands are dead, we will assign them different pseudos, creating
- invalid instructions, so union all uses of the same operand for each
- insn. */
-
- if (use_link)
- while (*use_link)
- {
- if (use != *use_link
- && DF_REF_REAL_REG (use) == DF_REF_REAL_REG (*use_link))
- (*fun) (use_entry + DF_REF_ID (use),
- use_entry + DF_REF_ID (*use_link));
- use_link++;
- }
+ /* Union all occurrences of the same register in reg notes. */
if (eq_use_link)
while (*eq_use_link)
if (NONDEBUG_INSN_P (insn))
{
df_ref *use_rec;
+ union_match_dups (insn, def_entry, use_entry, unionfind_union);
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
df_ref use = *use_rec;