ira-lives.c
48.3 KB
-
Use ira_setup_alts for conflict detection · 6de20b9d
make_early_clobber_and_input_conflicts records allocno conflicts between inputs and earlyclobber outputs. It (rightly) avoids doing this for inputs that are explicitly allowed to match the output due to matching constraints. The problem is that whether this matching is allowed varies between alternatives. At the moment the code avoids adding a clobber if *any* enabled alternative allows the match, even if some other operand makes that alternative impossible. The specific instance of this for SVE is that some alternatives allow matched earlyclobbers when a third operand X is constant zero. We should avoid adding conflicts when X really is constant zero, but should ignore the match if X is nonzero or nonconstant. ira_setup_alts can already filter these alternatives out for us, so all we need to do is use it in process_bb_node_lives. The preferred_alternatives variable is only used for this earlyclobber detection, so no other check should be affected. With the previous patch to check the reject weight in ira_setup_alts, this has the effect of ignoring expensive alternatives if we have other valid alternatives with zero cost. It seems reasonable to base the heuristic on only the alternatives that we'd actually like to use, but if this ends up being too aggressive, we could instead make the new reject behaviour conditional and only use it for add_insn_allocno_copies. 2019-07-01 Richard Sandiford <richard.sandiford@arm.com> gcc/ * ira-lives.c (process_bb_node_lives): Use ira_setup_alts. From-SVN: r272851
Richard Sandiford committed