
If the iteration count is really large, e.g. UINT_MAX, then the cost calculation can overflows and trigger an assert. So saturate the cost to INT_MAX if this is the case by using InstructionCost as a type which already supports this kind of overflow handling. This fixes #104761