Current implementation of loop exits optimization in LoopPredication uses minimum over all analyzable exits. For two exits case we don't actually need to take a minimum and can compare exit counts directly.

Legality: Currently for two exits case we generate if (P1) deopt, where P1:=(ec1 <= min(ec1, ec2)). Since "min(ec1, ec2) <= ec2" always holds thus if(P2) deopt, where P2:=(ec1 <= ec2) always holds if original condition holds. In other words transformed condition will always deopt if original deopted.

Profitability: If ec1<=ec2 then both P1 and P2 are true. If ec1 > ec2, then both P1 and P2 are false. That means that these two forms are identical.