
#9718: Avoid TidyPgm predicting what CorePrep will do -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: CodeGen, CAFs Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1):
Build an SRT for each closure that lists the CAFFy things it mentions. It's not obvious where that is done today -- can you point to it?
We don't build SRTs until Cmm (`doSRTs` in `CmmBuildInfoTables.hs`). In `TidyPgm` we decide on CAFFYness and record it in `IdInfo`s of binders. As far as I can see there are no CAF or SRT related computation done in STG. Btw, I found this commented-out code in `StgSyn`: {{{ pprStgExpr (StgLet srt (StgNonRec bndr (StgRhsClosure cc bi free_vars upd_flag args rhs)) expr@(StgLet _ _)) = ... }}} It seems like at some point someone tried to decorate `StgLet`s with SRTs. I don't understand how the CAFFYness info in Ids used in the code gen, but I wonder if even after this work there will still be room for bugs because `idCafInfo` of an id (not in binder position) may disagree with the final CAFFYness information of the id. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9718#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler