[Git][ghc/ghc][master] fix: Save FastStrings in the PMC
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: fa5defde by Rodrigo Mesquita at 2026-06-18T05:19:11-04:00 fix: Save FastStrings in the PMC There is no point in adding the unique to the occurrence FastString we create, since it is part of the Id anyway. Adding it to the FastString, meant each FastString was unique unnecessarily! In a separate branch, running the compiler on test `InstanceMatching` observed 30000 `FastString`s created by this code path. Plus, `fsLit "pm"` follows the existing pattern in `mkPmId`. - - - - - 1 changed file: - compiler/GHC/HsToCore/Pmc/Solver.hs Changes: ===================================== compiler/GHC/HsToCore/Pmc/Solver.hs ===================================== @@ -640,11 +640,11 @@ tyOracle ty_st@(TySt n inert) cts -- return the new inert set and increment the sequence number n ; return (TySt (n+1) <$> mb_new_inert) } --- | Allocates a fresh 'EvVar' name for 'PredTy's. +-- | Allocates a fresh 'EvVar' name for 'PredTy's nameTyCt :: PredType -> DsM EvVar nameTyCt pred_ty = do unique <- getUniqueM - let occname = mkVarOccFS (fsLit ("pm_"++show unique)) + let occname = mkVarOccFS $ fsLit "pm" return (mkUserLocalOrCoVar occname unique ManyTy pred_ty noSrcSpan) ----------------------------- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fa5defde38e319b2ff85026fee7630d3... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fa5defde38e319b2ff85026fee7630d3... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)