Simon Peyton Jones pushed to branch wip/T26425 at Glasgow Haskell Compiler / GHC Commits: 3fbcd9d3 by Simon Peyton Jones at 2025-11-14T17:03:00+00:00 Wibbles - - - - - 4 changed files: - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Types/Basic.hs - libraries/os-string - libraries/unix Changes: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -1049,9 +1049,9 @@ occAnalBind !env lvl ire (NonRec bndr rhs) thing_inside combine in if isDeadOcc occ -- Drop dead code; see Note [Dead code] then WUD body_uds body - else pprTrace "occAnal-nonrec" (vcat [ ppr bndr <+> ppr occ - , text "rhs_uds" <+> ppr rhs_uds - , text "body_uds" <+> ppr body_uds ]) $ + else -- pprTrace "occAnal-nonrec-join" (vcat [ ppr bndr <+> ppr occ + -- , text "rhs_uds" <+> ppr rhs_uds + -- , text "body_uds" <+> ppr body_uds ]) $ WUD (combineJoinPointUDs env rhs_uds body_uds) -- Note `orUDs` (combine [NonRec (fst (tagNonRecBinder lvl occ bndr')) rhs'] body) @@ -1069,7 +1069,10 @@ occAnalBind !env lvl ire (NonRec bndr rhs) thing_inside combine (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr !(rhs_uds, final_bndr, rhs') = occAnalNonRecRhs env lvl ire mb_join tagged_bndr rhs - in WUD (rhs_uds `andUDs` body_uds) -- Note `andUDs` + in -- pprTrace "occAnal-nonrec-nonjoin" (vcat [ ppr bndr <+> ppr occ + -- , text "rhs_uds" <+> ppr rhs_uds + -- , text "body_uds" <+> ppr body_uds ]) $ + WUD (rhs_uds `andUDs` body_uds) -- Note `andUDs` (combine [NonRec final_bndr rhs'] body) ----------------- @@ -2397,7 +2400,7 @@ preinlineUnconditionally here! The INLINE pragma says "inline exactly this RHS"; perhaps the programmer wants to expose that 'not', say. If we inline f that will make -the Stable unfoldign big, and that wasn't what the programmer wanted. +the Stable unfolding big, and that wasn't what the programmer wanted. Another way to think about it: if we inlined g as-is into multiple call sites, now there's be multiple calls to f. @@ -3734,10 +3737,13 @@ data UsageDetails instance Outputable UsageDetails where ppr ud@(UD { ud_env = env, ud_z_tail = z_tail }) - = text "UD" <+> (braces $ fsep $ punctuate comma $ - [ ppr uq <+> text ":->" <+> ppr (lookupOccInfoByUnique ud uq) - | (uq, _) <- nonDetStrictFoldVarEnv_Directly do_one [] env ]) - $$ nest 2 (text "ud_z_tail" <+> ppr z_tail) + = text "UD" <> (braces (vcat + [ -- `final` shows the result of a proper lookupOccInfo, returning OccInfo + -- after accounting for `ud_z_tail` etc. + text "final =" <+> (fsep $ punctuate comma $ + [ ppr uq <+> text ":->" <+> ppr (lookupOccInfoByUnique ud uq) + | (uq, _) <- nonDetStrictFoldVarEnv_Directly do_one [] env ]) + , text "ud_z_tail" <+> ppr z_tail ] )) where do_one :: Unique -> LocalOcc -> [(Unique,LocalOcc)] -> [(Unique,LocalOcc)] do_one uniq occ occs = (uniq, occ) : occs ===================================== compiler/GHC/Types/Basic.hs ===================================== @@ -1333,7 +1333,7 @@ zapFragileOcc occ = zapOccTailCallInfo occ instance Outputable OccInfo where -- only used for debugging; never parsed. KSW 1999-07 - ppr (ManyOccs tails) = pprShortTailCallInfo tails + ppr (ManyOccs tails) = text "Many" <> parens (pprShortTailCallInfo tails) ppr IAmDead = text "Dead" ppr (IAmALoopBreaker rule_only tails) = text "LoopBreaker" <> pp_ro <> pprShortTailCallInfo tails ===================================== libraries/os-string ===================================== @@ -1 +1 @@ -Subproject commit c08666bf7bf528e607fc1eacc20032ec59e69df3 +Subproject commit 2e693aad07540173a0169971b27c9acac28eeff1 ===================================== libraries/unix ===================================== @@ -1 +1 @@ -Subproject commit 60f432b76871bd7787df07dd3e2a567caba393f5 +Subproject commit c9b3e95b5c15b118e55522bd92963038c6a88160 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3fbcd9d370df5b6a31528067299c3b23... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3fbcd9d370df5b6a31528067299c3b23... You're receiving this email because of your account on gitlab.haskell.org.