Re: [Mesa-dev] [PATCH 1/2] [RFC] i965/vec4: Reward spills in if/else/endif blocks

2015-06-19 Thread Ben Widawsky
On Fri, Jun 19, 2015 at 08:04:51PM -0700, Matt Turner wrote: > On Fri, Jun 19, 2015 at 6:53 PM, Connor Abbott wrote: > > I don't think this is doing what you think it's doing. This code is > > for calculating the *cost* of spills, so a higher cost means a lower > > priority for choosing the regist

Re: [Mesa-dev] [PATCH 1/2] [RFC] i965/vec4: Reward spills in if/else/endif blocks

2015-06-19 Thread Matt Turner
On Fri, Jun 19, 2015 at 6:53 PM, Connor Abbott wrote: > I don't think this is doing what you think it's doing. This code is > for calculating the *cost* of spills, so a higher cost means a lower > priority for choosing the register. We increase the cost for things > inside loops because we don't w

Re: [Mesa-dev] [PATCH 1/2] [RFC] i965/vec4: Reward spills in if/else/endif blocks

2015-06-19 Thread Ben Widawsky
I'm not seeing where it does anything other than what I say. Beforehand the cost is increased (*=) from DO->WHILE. Now it should be decreased (/= 10) from IF->ENDIF. The factor of 10 probably needs to be modified since I suspect Can you help me see what I'm not seeing? On Fri, Jun 19, 2015 at 06:

Re: [Mesa-dev] [PATCH 1/2] [RFC] i965/vec4: Reward spills in if/else/endif blocks

2015-06-19 Thread Connor Abbott
I don't think this is doing what you think it's doing. This code is for calculating the *cost* of spills, so a higher cost means a lower priority for choosing the register. We increase the cost for things inside loops because we don't want to spill inside loops, and by doing the same thing for if's

[Mesa-dev] [PATCH 1/2] [RFC] i965/vec4: Reward spills in if/else/endif blocks

2015-06-19 Thread Ben Widawsky
If we have a register that needs spilling in an if/else block, there is a chance that we may not need to spill if we do[n't] take the branch. The downside of this patch is the case where the register being spilled ends up in both if/else blocks. For that case, preferring this path will increase co