Split the method isProfitableToInline.
Split the method isProfitableToInline.

This commit refactors the parts of isProfitableToInline that compute the cost
and benefit of inlining into a separate function. NFC.

khizkhiz/swift,khizkhiz/swift,khizkhiz/swift,khizkhiz/swift,khizkhiz/swift,khizkhiz/swift,khizkhiz/swift