[Git][ghc/ghc][wip/substitution-via-mapper] Fixing perf regressions in T27336, T9872d, T14683