Opt-in warning for large INLINE'd bindings?
In #18026 I by chance noticed that
coreView's unfolding (which has an
INLINE pragma) is unexpectedly quite huge. Inlining large quantities of code is bad since it blows up executable sizes. In the case of #18026 it was especially bad since the source of the majority of the code was a relatively unlikely path.
Ideally we would have some way to find cases like this. I can think of two options off-hand:
- an opt-in warning,
-Wlarge-inline=N, which throws a warning if the unfolding of an
INLINE'd binding is larger than `N.
- an external tool using the GHC API which reads interface file and reports the sizes of unfoldings.
Neither is great from a usability standpoint but either would be easy to implement and would be better than the status quo.