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