[GHC] #13219: CSE for join points

#13219: CSE for join points -------------------------------------+------------------------------------- Reporter: lukemaurer | Owner: lukemaurer Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: JoinPoints | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Join points are hazardous for CSE: {{{ join j = e in ... f e ... }}} The temptation is of course to rewrite to {{{ join j = e in ... f (jump j) ... }}} which doesn't typecheck because you can't have a jump in an argument. Similarly: {{{ join j x = e in let y = (... join j2 x = e in ...) in ... }}} can't be rewritten to {{{ join j x = e in let y = (... join j2 x = jump j x ...) in ... }}} because you can't jump out of a value binding. This doesn't seem to come up very often (took a long time for me to trip over it). The simple solution is simply to ignore CSE for join points. That's what we do at the moment. But this is saddening in some cases: {{{ join j x = e in join j2 x = e in ... }}} can perfectly well become {{{ join j x = e in join j2 x = jump j x in ... }}} We just need to track which join points are still currently valid. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13219 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13219: CSE for join points -------------------------------------+------------------------------------- Reporter: lukemaurer | Owner: lukemaurer Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: JoinPoints 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 simonpj):
We just need to track which join points are still currently valid.
Yes, and that would not be hard. Just keep a join-point reverse map in the CSEnv, alongside the existing `cs_map`; and discard it when going into non-tail positions. A relatively easy win, but as you say a modest one. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13219#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13219: CSE for join points -------------------------------------+------------------------------------- Reporter: lukemaurer | Owner: lukemaurer Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: JoinPoints, | CSE Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ezyang): * keywords: JoinPoints => JoinPoints, CSE -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13219#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC