Re: [RFA][PATCH][PR tree-optimization/64058] Improve and stabilize sorting of coalesce pairs

2016-03-19 Thread Jeff Law
On 03/15/2016 08:22 AM, Richard Biener wrote: To work around the narrow API in the comparison function we have to either store additional data in each node or have them available in globals. The former would be horribly wasteful, the latter is just ugly. I choose the latter in the lazy evaluati

Re: [RFA][PATCH][PR tree-optimization/64058] Improve and stabilize sorting of coalesce pairs

2016-03-18 Thread Jeff Law
On 03/14/2016 07:08 PM, Trevor Saunders wrote: To work around the narrow API in the comparison function we have to either store additional data in each node or have them available in globals. The former would be horribly wasteful, the latter is just ugly. I choose the latter in the lazy evalua

Re: [RFA][PATCH][PR tree-optimization/64058] Improve and stabilize sorting of coalesce pairs

2016-03-15 Thread Richard Biener
On Mon, Mar 14, 2016 at 11:32 PM, Jeff Law wrote: > On 03/11/2016 03:02 AM, Richard Biener wrote: >> >> >> >> For the other part I noticed a few things >> 1) having a bitmap_count_ior_bits () would be an improvement > > Yea, I almost built one. That's easy enough to add. > >> 2) you might end

Re: [RFA][PATCH][PR tree-optimization/64058] Improve and stabilize sorting of coalesce pairs

2016-03-14 Thread Trevor Saunders
On Mon, Mar 14, 2016 at 04:32:06PM -0600, Jeff Law wrote: > On 03/11/2016 03:02 AM, Richard Biener wrote: > > > > > >For the other part I noticed a few things > > 1) having a bitmap_count_ior_bits () would be an improvement > Yea, I almost built one. That's easy enough to add. > > > 2) you migh

Re: [RFA][PATCH][PR tree-optimization/64058] Improve and stabilize sorting of coalesce pairs

2016-03-14 Thread Jeff Law
On 03/11/2016 03:02 AM, Richard Biener wrote: For the other part I noticed a few things 1) having a bitmap_count_ior_bits () would be an improvement Yea, I almost built one. That's easy enough to add. 2) you might end up with redundant work(?) as you are iterating over SSA name coales

Re: [RFA][PATCH][PR tree-optimization/64058] Improve and stabilize sorting of coalesce pairs

2016-03-11 Thread Jeff Law
On 03/11/2016 03:02 AM, Richard Biener wrote: [Big snip] Can you please split out the 'index' introduction as a separate patch and apply that? I think it is quite obviously a good idea and might make regression hunting easier later if needed. Done. Actual patch installed attached for archival

Re: [RFA][PATCH][PR tree-optimization/64058] Improve and stabilize sorting of coalesce pairs

2016-03-11 Thread Richard Biener
On Fri, Mar 11, 2016 at 4:01 AM, Jeff Law wrote: > > As discussed in the BZ, we have multiple problems with how we sort the > coalesce list during out-of-ssa coalescing. > > First, the sort is not stable. If the cost of two coalesce pairs is the > same, we break the tie by looking at the underlyi

[RFA][PATCH][PR tree-optimization/64058] Improve and stabilize sorting of coalesce pairs

2016-03-10 Thread Jeff Law
As discussed in the BZ, we have multiple problems with how we sort the coalesce list during out-of-ssa coalescing. First, the sort is not stable. If the cost of two coalesce pairs is the same, we break the tie by looking at the underlying SSA_NAME_VERSION of the first, then the second eleme