[GHC] #5916: runST isn't free
GHC
ghc-devs at haskell.org
Thu Jan 9 08:37:44 UTC 2014
#5916: runST isn't free
-------------------------------------+------------------------------------
Reporter: tibbe | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.6.2
Component: Compiler | Version: 7.4.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by simonpj):
I think the Right Thing here is to add a case to `CorePrep` that (in
effect) inlines `runSTRep` on the spot. At that point there are no
further transformations to worry about.
Also it occurs to me that the C-- code for these two code fragments will
be nearly identical
{{{
(1) case st_rep s of (# _, r #) -> r
(2) st_rep s
}}}
The latter will be a tail call; the former will push a return frame, call,
and then simply return after that. So we could maybe code-gen (1) just
like (2).
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/5916#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list