Admin message

Due to a large amount of spam we do not allow new users to create repositories, they are "external" users. If you are a new user and want to create a repository, for example for forking GHC, open a new issue on ghc/ghc using the "get-verified" issue template

Cost centre ticks should not destroy join contexts.
See also * #26693 * #26422 * #26642 ## Summary After having looked into the cmm code we generate for cost centres a bit it's unclear to me why they are preventing us from turning certain functions into tail calls. Consider this example: ```haskell {-# OPTIONS_GHC -dno-typeable-binds -O -fforce-recomp -ddump-simpl -ddump-to-file #-} module M where foo :: Int -> Int -> Int -> Int foo s x y = let f :: Int -> Int g :: Int -> Int {-# NOINLINE f #-} f x = y + 11 + x {-# NOINLINE g #-} g x = y + 12 + x in case s of 0 -> {-# SCC foo #-} f x 1 -> g x 2 -> f (x+1) 3 -> g (x+1) 4 -> f (x+2) 5 -> g (x+2) 6 -> f (x+3) _ -> g (x+3) ``` When compiled with `-prof` we turn `g` into a join point but won't do so for `f` because of the cost centre in the case alternative. However I don't see any good reason to put this strong a restriction onto join points when it comes to cost centres. The code we emit to keep track of cost centres doesn't manipulate the cost centre stack. So it should be perfectly fine to turn `f` into a join point and just do the same operations inline instead. For reference here is the Cmm of two case alternatives calling `f`, one with cost centre, one without: ``` cRc: // global (_cRy::I64) = call "ccall" arg hints: [PtrHint, PtrHint] result hints: [PtrHint] pushCostCentre(CCCS, foo); I64[_cRy::I64 + 48] = I64[_cRy::I64 + 48] + 1; CCCS = _cRy::I64; R2 = _sQg::I64; R1 = _cQR::P64; call $wf_sQi_info(R2, R1) args: 8, res: 0, upd: 8; cRe: // global R2 = _sQg::I64 + 1; R1 = _cQR::P64; call $wf_sQi_info(R2, R1) args: 8, res: 0, upd: 8; ``` ## Environment * GHC version used: Any
issue