Draft: Transitive specialization support
The idea is rather simple.
If we mark a binding as SPECREC
then all functions calling that binding will be marked as such as well.
Any binding marked as SPECREC
either directly or transitively will have their unfoldings exposed and be specialized if possible.
Implementation wise we put the SPECREC flag on ids to carry this information, and transfer this from callees to callers in a separate pass.
This will need a ghc proposal and isn't completely finished yet. TH/Haddock support is missing. We might run the pass to transfer the SPECREC
flag to callers too often. But putting the proof of concept up as MR already.
NB: This is based on !9621 so the diff will be a bit smaller once that has been merged.