Adam Gundry pushed to branch wip/amg/castz at Glasgow Haskell Compiler / GHC Commits: bd2aa21d by Adam Gundry at 2025-07-24T20:08:56+01:00 Attempt to improve T5030 by zapping in ds_hs_wrapper - - - - - 1 changed file: - compiler/GHC/HsToCore/Binds.hs Changes: ===================================== compiler/GHC/HsToCore/Binds.hs ===================================== @@ -58,6 +58,7 @@ import GHC.Core.Type import GHC.Core.Coercion import GHC.Core.Rules import GHC.Core.TyCo.Compare( eqType ) +import GHC.Core.TyCo.FVs import GHC.Builtin.Names import GHC.Builtin.Types ( naturalTy, typeSymbolKind, charTy ) @@ -1666,7 +1667,12 @@ ds_hs_wrapper wrap = go wrap go (WpEvLam ev) k = k $ Lam ev go (WpTyLam tv) k = k $ Lam tv go (WpCast co) k = assert (coercionRole co == Representational) $ - k $ \e -> mkCastDs e co + do { zap_casts <- hasZapCasts <$> getDynFlags + ; k $ \e -> -- AMG TODO: clean this up if it helps T5030 + if zap_casts + then (if isReflCo co then e else mkCastZ e (coercionRKind co) (shallowCoVarsOfCo co)) + else mkCastDs e co + } go (WpEvApp tm) k = do { core_tm <- dsEvTerm tm ; k $ \e -> e `App` core_tm } go (WpLet ev_binds) k = dsTcEvBinds ev_binds $ \bs -> View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bd2aa21d6c8a6d9eb1a0576dbf354fe9... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bd2aa21d6c8a6d9eb1a0576dbf354fe9... You're receiving this email because of your account on gitlab.haskell.org.