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. Non canonical gimple generated at if conversion <bb 27>: _496 = _512 == 2; _495 = red_cost_503 > 0; _494 = _496 & _495; if (_494 != 0) goto <bb 28>; else goto <bb 29>; should be retain the correct order when we swap back to make it canonical ?