]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/ira-lives.c
Use ira_setup_alts for conflict detection
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Jul 2019 08:58:44 +0000 (08:58 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Jul 2019 08:58:44 +0000 (08:58 +0000)
commitf278a92ec6afeb869589d5896c87e5532eb49ef5
treecda310e70ab924dc48ca02e12b52807ee54d4a17
parent341b1932c5302ca314a078a24812d8fc18c9ad38
Use ira_setup_alts for conflict detection

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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272851 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/ira-lives.c