Simon Peyton Jones pushed to branch wip/T27737 at Glasgow Haskell Compiler / GHC Commits: aeb276b0 by Simon Peyton Jones at 2026-09-23T09:37:52+01:00 Fix join points Split contininuations *first* - - - - - 1 changed file: - compiler/GHC/Core/Opt/Simplify/Iteration.hs Changes: ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -1311,21 +1311,24 @@ simplExprF1 env (Let (NonRec bndr rhs) body) cont tick (PreInlineUnconditionally bndr) ; simplExprF env' body cont } +simplExprF1 env expr@(Let {}) cont + | not (seCaseCase env) + , (inner, outer) <- splitContArgs cont + , not (contIsStop outer) + = do { expr' <- simplExprC env expr inner + ; rebuild env expr' outer } + -- Now check for a join point. It's better to do the preInlineUnconditionally -- test first, because joinPointBinding_maybe has to eta-expand, so a trivial -- binding like { j = j2 |> co } would first be eta-expanded and then inlined -- Better to test preInlineUnconditionally first. +-- +-- Must be after the seCaseCase stuff: todo: explain why +-- Example GHC.Internal.Debug simplExprF1 env (Let bind body) cont | Just bind' <- joinPointBind_maybe bind = simplJoinPointBind env bind' body cont -simplExprF1 env expr@(Let {}) cont - | not (seCaseCase env) - , (inner, outer) <- splitContArgs cont - , not (contIsStop outer) - = do { expr' <- simplExprC env expr inner - ; rebuild env expr' outer } - -- Non-recursive let simplExprF1 env (Let (NonRec bndr rhs) body) cont = {-#SCC "simplNonRecE" #-} View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aeb276b02467316e5ef8bf5dea60a2f6... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aeb276b02467316e5ef8bf5dea60a2f6... 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)
-
Simon Peyton Jones (@simonpj)