> ------------------------------------------------------------------ > Sender:Jakub Jelinek > Sent At:2019 Apr. 17 (Wed.) 19:27 > Recipient:Bin.Cheng > Cc:bin.cheng ; GCC Patches > Subject:Re: [PATCH PR90078]Capping comp_cost computation in ivopts > > > On Wed, Apr 17, 2019 at 07:14:05PM +0800, Bin.Cheng wrote: > > > As > > > #define INFTY 10000000 > > > what is the reason to keep the previous condition as well? > > > I mean, if cost1.cost == INFTY or cost2.cost == INFTY, > > > cost1.cost + cost2.cost >= INFTY too. > > > Unless costs can go negative. > > It's a bit complicated, but in general, costs can go negative. > > Ok, no objections from me then (but as I don't know anything about it, > not an ack either; you are ivopts maintainer, so you don't need one). Hi, The previous patch was reverted on GCC-9 because of PR90240. PR90240 is now fixed by another patch. This is the updated patch for PR90078. It promotes type of ivopts cost from int to int64_t, as well as change behavior of infinite_cost overflow from saturation to assert. Please note, implicit conversions are kept in cost computation as before without introducing any narrowing. Bootstrap/test on x86_64 along with PR90240 patch. Is it OK? Thanks, bin 2019-05-05 Bin Cheng PR tree-optimization/90078 * tree-ssa-loop-ivopts.c (inttypes.h): Include new header file. (INFTY): Increase the value for infinite cost. (struct comp_cost): Promote type of members to int64_t. (infinite_cost): Don't set complexity in initialization. (comp_cost::operator +,-,+=,-+,/=,*=): Assert when cost computation overflows to infinite_cost. (adjust_setup_cost): Promote type of parameter and cost computation to int64_t. (struct ainc_cost_data, struct iv_ca): Promote type of member to int64_t. (get_scaled_computation_cost_at, determine_iv_cost): Promote type of cost computation to int64_t. (determine_group_iv_costs, iv_ca_dump, find_optimal_iv_set): Use int64_t's format specifier in dump. 2018-05-05 Bin Cheng PR tree-optimization/90078 * g++.dg/tree-ssa/pr90078.C: New test.