+/* 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));
+ }
+}
+