This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Explicit move preference hints
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Vladimir Makarov <vmakarov at redhat dot com>, nd <nd at arm dot com>
- Date: Wed, 23 Aug 2017 11:59:18 -0500
- Subject: Re: RFC: Explicit move preference hints
- Authentication-results: sourceware.org; auth=none
- References: <DB6PR0801MB2053895F9C913295E4C16F3B83840@DB6PR0801MB2053.eurprd08.prod.outlook.com>
Hi!
On Tue, Aug 22, 2017 at 10:48:17AM +0000, Wilco Dijkstra wrote:
> The register allocator inserts move preferences when an instruction has
> one or more dead sources in add_insn_allocno_copies. If an instruction
> doesn't have a matching constraint (eg. "0"), then any dead source is treated
> as a copy with all destination registers with a low priority. In reality what
> appears to happen is that the first dead source is treated as a copy. This
> leads to non-intuitive allocations in eg. 4-register FMAs. Here you'd
> prefer to have the accumulator and destination to use the same register
> when possible: so fmadd d2, d0, d5, d2 instead of fmadd d0, d0, d5, d2.
You could add a preferred alternative that uses "0" to such instruction
patterns, will that help?
Segher