- /* Recognize trivial noop moves and attempt to keep them as noop.
- While most of noop moves should be removed, we still keep some
- of them at libcall boundaries and such. */
+ In USED, we keep the DF_REF_ID of the first uninitialized uses of a
+ register, so that all uninitialized uses of the register can be
+ combined into a single web. We actually offset it by 2, because
+ the values 0 and 1 are reserved for use by entry_register. */
+
+void
+union_defs (df_ref use, struct web_entry *def_entry,
+ unsigned int *used, struct web_entry *use_entry,
+ bool (*fun) (struct web_entry *, struct web_entry *))
+{
+ struct df_insn_info *insn_info = DF_REF_INSN_INFO (use);
+ struct df_link *link = DF_REF_CHAIN (use);
+ df_ref *eq_use_link;
+ df_ref *def_link;
+ rtx set;
+
+ if (insn_info)
+ {
+ rtx insn = insn_info->insn;
+ 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. */
+ eq_use_link = NULL;
+ def_link = NULL;
+ set = NULL;
+ }
+
+ /* Union all occurrences of the same register in reg notes. */
+
+ if (eq_use_link)
+ while (*eq_use_link)
+ {
+ if (use != *eq_use_link
+ && DF_REF_REAL_REG (use) == DF_REF_REAL_REG (*eq_use_link))
+ (*fun) (use_entry + DF_REF_ID (use),
+ use_entry + DF_REF_ID (*eq_use_link));
+ eq_use_link++;
+ }
+
+ /* Recognize trivial noop moves and attempt to keep them as noop. */