sheaf pushed to branch wip/andreask/ticked_joins at Glasgow Haskell Compiler / GHC
Commits:
-
f84e5d95
by sheaf at 2026-01-26T21:49:00+01:00
3 changed files:
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Monad.hs
Changes:
| ... | ... | @@ -2299,7 +2299,7 @@ occ_anal_lam_tail env (Cast expr co) |
| 2299 | 2299 | _ -> usage1
|
| 2300 | 2300 | |
| 2301 | 2301 | -- usage3: see Note [Quasi join points] in GHC.Core.Opt.Simplify.Iteration.
|
| 2302 | - usage3 = markAllQuasiTail usage2 -- SLD TODO
|
|
| 2302 | + usage3 = markAllNonTail usage2 -- SLD TODO
|
|
| 2303 | 2303 | |
| 2304 | 2304 | in WUD usage3 (Cast expr' co)
|
| 2305 | 2305 | |
| ... | ... | @@ -2602,6 +2602,7 @@ occAnal env (Tick tickish body) |
| 2602 | 2602 | | Breakpoint _ _ ids <- tickish
|
| 2603 | 2603 | = -- Never substitute for any of the Ids in a Breakpoint
|
| 2604 | 2604 | addManyOccs usage_lam (mkVarSet ids)
|
| 2605 | + |
|
| 2605 | 2606 | | otherwise
|
| 2606 | 2607 | = usage_lam
|
| 2607 | 2608 | |
| ... | ... | @@ -2611,7 +2612,7 @@ occAnal env (Cast expr co) |
| 2611 | 2612 | = let (WUD usage expr') = occAnal env expr
|
| 2612 | 2613 | usage1 = addManyOccs usage (coVarsOfCo co)
|
| 2613 | 2614 | -- usage1: see Note [Gather occurrences of coercion variables]
|
| 2614 | - usage2 = markAllQuasiTail usage1 -- SLD TODO
|
|
| 2615 | + usage2 = markAllNonTail usage1 -- SLD TODO
|
|
| 2615 | 2616 | -- usage2: see Note [Quasi join points]
|
| 2616 | 2617 | in WUD usage2 (Cast expr' co)
|
| 2617 | 2618 | |
| ... | ... | @@ -2748,7 +2749,6 @@ occAnalApp env (Var fun, args, ticks) |
| 2748 | 2749 | | fun `hasKey` runRWKey
|
| 2749 | 2750 | , [t1, t2, arg] <- args
|
| 2750 | 2751 | , WUD usage arg' <- adjustNonRecRhs (Just 1) $ occAnalLamTail env arg
|
| 2751 | - -- SLD TODO TrueJoinPoint OK here??
|
|
| 2752 | 2752 | = let app_out = mkTicks ticks $ mkApps (Var fun) [t1, t2, arg']
|
| 2753 | 2753 | in WUD usage app_out
|
| 2754 | 2754 |
| ... | ... | @@ -2135,7 +2135,7 @@ trimJoinCont _ NotJoinPoint cont |
| 2135 | 2135 | = cont -- Not a jump
|
| 2136 | 2136 | trimJoinCont var (JoinPoint { joinPointType = join_ty, joinPointArity = arity }) cont
|
| 2137 | 2137 | | QuasiJoinPoint <- join_ty
|
| 2138 | - -- SLD TODO: not sure why we can end up here. Needs further investigation.
|
|
| 2138 | + -- As per Note [Quasi join points], don't do any trimming for quasi join points.
|
|
| 2139 | 2139 | = cont
|
| 2140 | 2140 | | otherwise
|
| 2141 | 2141 | = trim arity cont
|
| ... | ... | @@ -214,7 +214,7 @@ newJoinId bndrs body_ty |
| 214 | 214 | -- arity: See Note [Invariants on join points] invariant 2b, in GHC.Core
|
| 215 | 215 | join_arity = length bndrs
|
| 216 | 216 | details = JoinId
|
| 217 | - { joinIdType = TrueJoinPoint
|
|
| 217 | + { joinIdType = TrueJoinPoint -- SLD TODO this is very suspicious
|
|
| 218 | 218 | , joinIdArity = join_arity
|
| 219 | 219 | , joinIdCbvMarks = Nothing
|
| 220 | 220 | }
|