https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78200
--- Comment #18 from rguenther at suse dot de <rguenther at suse dot de> --- On Tue, 15 Nov 2016, venkataramanan.kumar at amd dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78200 > > --- Comment #17 from Venkataramanan <venkataramanan.kumar at amd dot com> --- > Looking at the check > red_cost < 0 && arc->ident == AT_LOWER) > || (red_cost > 0 && arc->ident == AT_UPPER > > The order if-combine created seem to be the best. > > if (red_cost_86 < 0) > goto <bb 17>; > else > goto <bb 18>; > > <bb 17>: > if (_23 == 1) > goto <bb 19>; > else > goto <bb 20>; > > <bb 18>: > _340 = _23 == 2; > _341 = red_cost_86 > 0; > _338 = _340 & _341; > if (_338 != 0) > goto <bb 19>; > else > goto <bb 20>; > > <bb 19>: > basket_size.5_30 = basket_size; > _31 = basket_size.5_30 + 1; > basket_size = _31; > _32 = perm[_31]; > _32->a = arc_47; > _32->cost = red_cost_86; > _33 = ABS_EXPR <red_cost_86>; > _32->abs_cost = _33; > > If red_cost < 0 is false then checking for arc->ident == AT_UPPER first. This > is better, since we know red_cost >0 will always be true. red_cost can be zero. The "bad" order is best (just slower for some still unknown reason).