Re: Register allocation trouble

2017-07-24 Thread Jeff Law
On 07/24/2017 11:37 AM, Georg-Johann Lay wrote: > Andrew Stubbs schrieb: >> On 24/07/17 14:58, Georg-Johann Lay wrote: >>> Dunno if that works in all situation. For example, when the register >>> allocator is facing high register pressure and decides to spill the >>> target register, it uses the c

Re: Register allocation trouble

2017-07-24 Thread Georg-Johann Lay
Andrew Stubbs schrieb: On 24/07/17 14:58, Georg-Johann Lay wrote: Dunno if that works in all situation. For example, when the register allocator is facing high register pressure and decides to spill the target register, it uses the constraints of the matched insn. That would be a memory to me

Re: Register allocation trouble

2017-07-24 Thread Andrew Stubbs
On 24/07/17 14:58, Georg-Johann Lay wrote: Dunno if that works in all situation. For example, when the register allocator is facing high register pressure and decides to spill the target register, it uses the constraints of the matched insn. That would be a memory to memory move, and therefore

Re: Register allocation trouble

2017-07-24 Thread Georg-Johann Lay
On 24.07.2017 13:38, Andrew Stubbs wrote: Thanks to all those who replied. :-) Here's what I've done to fix the problem: 1. Set the base rclass to A only. 2. Configured secondary reloads to B via A. 3. Disabled the Rb constraint. [*] That's enough to create correct code, but it's pretty horr

Re: Register allocation trouble

2017-07-24 Thread Andrew Stubbs
Thanks to all those who replied. :-) Here's what I've done to fix the problem: 1. Set the base rclass to A only. 2. Configured secondary reloads to B via A. 3. Disabled the Rb constraint. [*] That's enough to create correct code, but it's pretty horrible, so I also added new patterns of the

Re: Register allocation trouble

2017-07-21 Thread Jeff Law
On 07/21/2017 12:40 PM, Nathan Sidwell wrote: > On 07/21/2017 07:50 AM, Andrew Stubbs wrote: > >> (set (match_operand:SI "register_operand" "=a,b") >> (match_operand:SI "memory_operand" "Ra,Rb")) > > > How horrible would it be to split expose the entire mem: > > (set (match_operand:SI "

Re: Register allocation trouble

2017-07-21 Thread Richard Earnshaw
On 21/07/17 19:40, Nathan Sidwell wrote: > On 07/21/2017 07:50 AM, Andrew Stubbs wrote: > >> (set (match_operand:SI "register_operand" "=a,b") >> (match_operand:SI "memory_operand" "Ra,Rb")) > > > How horrible would it be to split expose the entire mem: > > (set (match_operand:SI "regis

Re: Register allocation trouble

2017-07-21 Thread Nathan Sidwell
On 07/21/2017 07:50 AM, Andrew Stubbs wrote: (set (match_operand:SI "register_operand" "=a,b") (match_operand:SI "memory_operand" "Ra,Rb")) How horrible would it be to split expose the entire mem: (set (match_operand:SI "register" "=a,b") (mem:SI (match_operand:SI "register" "a,

Re: Register allocation trouble

2017-07-21 Thread Georg-Johann Lay
Andrew Stubbs schrieb: Hi all, I have an architecture that has two register files. Let's call them class A and class B. There are some differences between their capabilities, but for the purposes of this problem, they can be considered to be identical, both holding SImode values, and both abl

Re: Register allocation trouble

2017-07-21 Thread Jeff Law
On 07/21/2017 05:50 AM, Andrew Stubbs wrote: > Hi all, > > I have an architecture that has two register files. Let's call them > class A and class B. There are some differences between their > capabilities, but for the purposes of this problem, they can be > considered to be identical, both holdin

Register allocation trouble

2017-07-21 Thread Andrew Stubbs
Hi all, I have an architecture that has two register files. Let's call them class A and class B. There are some differences between their capabilities, but for the purposes of this problem, they can be considered to be identical, both holding SImode values, and both able to receive values wit