RE: Understanding IRA (The Story so far)

2009-12-14 Thread Ian Bolton
For those who have been following my adventure in the world of IRA, or just want to take advantage of some of the time I've spent on this, here's a detailed recap of my exploits and my current status (which I'm very happy with): I initially thought IRA was calculating costs wrongly for our

RE: Understanding IRA

2009-12-07 Thread Ian Bolton
Jeff Law wrote: I had an epiphany this morning and came up with an idea to achieve the lookahead I thought I needed, thereby making the costs created by '?' a lot more concrete and reliable. Firstly, I have altered the alt_cost adjustment (for '?') in ira- costs.c, so that it only

Re: Understanding IRA

2009-12-03 Thread Jeff Law
On 12/02/09 13:29, Ian Bolton wrote: I had an epiphany this morning and came up with an idea to achieve the lookahead I thought I needed, thereby making the costs created by '?' a lot more concrete and reliable. Firstly, I have altered the alt_cost adjustment (for '?') in ira-costs.c, so that

RE: Understanding IRA

2009-12-02 Thread Ian Bolton
Jeff Law wrote: Ian Bolton wrote: Initial results showed that IRA was moving input arguments out of their BOTTOM_REGS (e.g. $c1) into TOP_CREGS to do work on them, since it thought TOP_CREGS were less costly to use, despite the cost of the move instruction to get the input argument

Re: Understanding IRA

2009-11-30 Thread Jeff Law
On 11/19/09 08:40, Ian Bolton wrote: Jeff Law wrote: On 11/16/09 10:33, Ian Bolton wrote: The question is: how to fix this? I have initially put the REG_ALLOC_ORDER back to how it was and changed the operand constraints in our MD file, so each of the

RE: Understanding IRA

2009-11-19 Thread Ian Bolton
Jeff Law wrote: On 11/16/09 10:33, Ian Bolton wrote: The question is: how to fix this? I have initially put the REG_ALLOC_ORDER back to how it was and changed the operand constraints in our MD file, so each of the apathetic instructions, will either take a 't' (TOP_CREG) or '?b'

RE: Understanding IRA

2009-11-16 Thread Ian Bolton
Ian Bolton wrote: Ian Bolton wrote: Vladimir Makarov wrote: Ian Bolton wrote: Yesterday, I wrote: BTW, today I have achieved some good results with existing IRA by doing the following: 1) Changed the REG_ALLOC_ORDER so that TOP_CREGS are given out before

RE: Understanding IRA

2009-11-11 Thread Ian Bolton
Yesterday, I wrote: BTW, today I have achieved some good results with existing IRA by doing the following: 1) Changed the REG_ALLOC_ORDER so that TOP_CREGS are given out before BOTTOM_REGS. My previous hacked version worked by increasing the priority of those that wanted BOTTOM_REGS, so

Re: Understanding IRA

2009-11-11 Thread Jeff Law
On 11/11/09 08:18, Ian Bolton wrote: Good news! I have been able to remove my total_costs hack above by instead commenting out the following line from ira_build() in ira-build.c: remove_unnecessary_regions (false); Which is probably an indication of a problem elsewhere. However, it's

Re: Understanding IRA

2009-11-11 Thread Vladimir Makarov
Ian Bolton wrote: Yesterday, I wrote: BTW, today I have achieved some good results with existing IRA by doing the following: 1) Changed the REG_ALLOC_ORDER so that TOP_CREGS are given out before BOTTOM_REGS. My previous hacked version worked by increasing the priority of those that wanted

RE: Understanding IRA

2009-11-11 Thread Ian Bolton
Vladimir Makarov wrote: Ian Bolton wrote: Yesterday, I wrote: BTW, today I have achieved some good results with existing IRA by doing the following: 1) Changed the REG_ALLOC_ORDER so that TOP_CREGS are given out before BOTTOM_REGS. My previous hacked version worked by increasing

RE: Understanding IRA

2009-11-11 Thread Ian Bolton
Ian Bolton wrote: Vladimir Makarov wrote: Ian Bolton wrote: Yesterday, I wrote: BTW, today I have achieved some good results with existing IRA by doing the following: 1) Changed the REG_ALLOC_ORDER so that TOP_CREGS are given out before BOTTOM_REGS. My previous hacked

RE: Understanding IRA

2009-11-10 Thread Dave Hudson
On Mon, 2009-11-09 at 14:13 +, Ian Bolton wrote: Dave Hudson wrote: I've been working on gcc for an ISA (Ubicom32) that seems to have some similarities to the problem you're seeing (we have some regs that can be used for many things but not all) and was seeing a ton a pointless

Re: Understanding IRA

2009-11-10 Thread Jeff Law
On 11/06/09 05:53, Dave Hudson wrote: the most critical thing was to ensure that REGNO_REG_CLASS was returning a minimal class correctly. I believe that's been documented as the right thing to do for about 15 years :-) So, yes, you definitely want REGNO_REG_CLASS to return the smallest

RE: Understanding IRA

2009-11-10 Thread Ian Bolton
On 11/06/09 05:53, Dave Hudson wrote: the most critical thing was to ensure that REGNO_REG_CLASS was returning a minimal class correctly. I believe that's been documented as the right thing to do for about 15 years :-) So, yes, you definitely want REGNO_REG_CLASS to return the

Fwd: Re: Understanding IRA

2009-11-10 Thread Jeff Law
[ Per Ian's request I'm forwarding some discussion we had on IRA to the list. ] On 11/04/09 12:24, Ian Bolton wrote: Hi Jeff and Vladimir, (I wasn't sure whether to CC the mailing list. Your guidance on this would be appreciated, since I am very new to the GNU community.) Your choice.

RE: Understanding IRA

2009-11-09 Thread Ian Bolton
Dave Hudson wrote: On Thu, 2009-11-05 at 18:05 +, Ian Bolton wrote: I think I may have made a breakthrough! As mentioned above, IRA is correctly increasing the cost for TOP_REGS when an allocno in region 1 is being used in one of our special instructions that needs BOTTOM_REGS. We

Re: Understanding IRA

2009-11-04 Thread Vladimir Makarov
Jeff Law wrote: On 11/03/09 09:29, Ian Bolton wrote: Hi again, Vladimir, I am pleased to report some performance improvements after altering ira-costs.c. A key benchmark for us has improved by 5%. Specifically, in record_reg_classes(), after the alt_cost has been calculated and it will be

RE: Understanding IRA

2009-11-04 Thread Ian Bolton
! Is there an ETA on when reload will be gone away? ;-) Best regards, Ian -Original Message- From: Jeff Law [mailto:l...@redhat.com] Sent: 22 October 2009 23:05 To: Ian Bolton Cc: Vladimir Makarov; gcc@gcc.gnu.org Subject: Re: Understanding IRA On 10/19/09 12:30, Ian Bolton wrote: Hi Jeff

Re: Understanding IRA

2009-11-04 Thread Jeff Law
On 11/04/09 10:52, Ian Bolton wrote: Hi Jeff, From an empirical perspective, the value of your patch is hard to determine at this stage - one benchmark improved about 0.5% but others have marginally regressed. It's a hack, no doubt about it. Your results are about what I expected, a few

Re: Understanding IRA

2009-11-04 Thread Jeff Law
On 11/04/09 10:14, Vladimir Makarov wrote: I am agree with Jeff. It is hard to understand what you are doing without the architecture knowledge and some macro values in your port (IRA_COVER_CLASSES, MEMORY_MOVE_COST, and REGISTER_MOVE_COST). I'd also add that besides right macro value

RE: Understanding IRA

2009-11-03 Thread Ian Bolton
Hi again, Vladimir, I am pleased to report some performance improvements after altering ira-costs.c. A key benchmark for us has improved by 5%. Specifically, in record_reg_classes(), after the alt_cost has been calculated and it will be applied to pp-mem_cost and pp-cost[k], I check whether

Re: Understanding IRA

2009-11-03 Thread Jeff Law
On 11/03/09 09:29, Ian Bolton wrote: Hi again, Vladimir, I am pleased to report some performance improvements after altering ira-costs.c. A key benchmark for us has improved by 5%. Specifically, in record_reg_classes(), after the alt_cost has been calculated and it will be applied to

Re: Understanding IRA

2009-10-22 Thread Jeff Law
On 10/19/09 12:30, Ian Bolton wrote: Hi Jeff and Vladimir. Jeff: I'd be interested in trying the patch if you can send it my way. It's nothing special. /* Return nonzero if REGNO is a particularly bad choice for reloading X. */ static int ira_bad_reload_regno_1 (int regno, rtx x) { int

RE: Understanding IRA

2009-10-19 Thread Ian Bolton
: Understanding IRA On 10/16/09 08:53, Vladimir Makarov wrote: The biggest problem of GCC RA is still reload pass. It frequently changes decisions of IRA not in a good way. Agreed. Not only may reload make a bad choice, it's horribly unpredictable. Trivial changes often lead to drastically different

Re: Understanding IRA

2009-10-19 Thread Vladimir Makarov
Ian Bolton wrote: Hi Jeff and Vladimir. Jeff: I'd be interested in trying the patch if you can send it my way. Vladimir: Today I have seen reasonable improvements on progressively-trimmed-down versions of a *single* test case by applying some cost adjustments in the case when an operand wants

Understanding IRA

2009-10-16 Thread Ian Bolton
Hi Vladimir, I have just begun working for Icera Inc, on a private port of GCC, and my first task has been to investigate the performance impact of using the Chaitin-Briggs algorithm of IRA vs the priority algorithm that we currently have enabled in our production compiler (due to not defining