[Git][ghc/ghc][master] Reduce SpecConstr threshold in GHC.Tc.Solver.Rewrite
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 556db2f3 by sheaf at 2026-08-10T21:32:06-04:00 Reduce SpecConstr threshold in GHC.Tc.Solver.Rewrite As remarked in #27628, this module currently sits on a knife's edge: if the body of 'simplifyArgsWorker' is made even a tiny bit smaller, then SpecConstr suddenly kicks in and causes disastrous reboxing of the LiftingContext argument. To make this less likely to happen, this commit lowers the SpecConstr threshold. - - - - - 1 changed file: - compiler/GHC/Tc/Solver/Rewrite.hs Changes: ===================================== compiler/GHC/Tc/Solver/Rewrite.hs ===================================== @@ -1,3 +1,13 @@ +{-# OPTIONS_GHC -fspec-constr-threshold=1200 #-} + -- This threshold (smaller than the default 2000) avoids SpecConstr from firing + -- on the inner loop of GHC.Core.Reduction.simplifyArgsWorker (inlined into + -- this module) based on a 'LiftingContext' argument, as this causes + -- significant reboxing (regressing compile-time allocations in T9872d by ~4%), + -- as per #27628. + -- + -- The 1200 threshold was chosen to avoid this issue while still allowing + -- beneficial SpecConstr to fire in the rest of the module. + module GHC.Tc.Solver.Rewrite( rewrite, rewriteForErrors, rewriteArgsNom, rewriteType View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/556db2f32f59ec2d3b1c225d24d677c6... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/556db2f32f59ec2d3b1c225d24d677c6... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Marge Bot (@marge-bot)