
#10137: Rewrite switch code generation -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 (CodeGen) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9157, #8326, | Differential Revisions: #8317 | -------------------------------------+------------------------------------- Changes (by jstolarek): * related: => #9157, #8326, #8317 Comment:
The Common Block Optimization on Cmm happens later in the pipeline, making it non-trivial to detect branches that do the same thing. #9157 demonstrates a case where CBE fails, although it definitely shouldn't.
Re #8326 I spent several weeks trying to fix it but ultimately I failed. You can find various experimental versions of my code on these branches: [[https://github.com/jstolarek/ghc/tree/T8326-heap-checks|T8326-heap- checks]] [[https://github.com/jstolarek/ghc/tree/T8326-heap-checks-aletr- gc_plan|T8326-heap-checks-aletr-gc_plan]] [[https://github.com/jstolarek/ghc/tree/T8326-heap-checks-alternative- plan|T8326-heap-checks-alternative-plan]] [[https://github.com/jstolarek/ghc/tree/T8326-heap-checks-precompile- alts|T8326-heap-checks-precompile-alts]] though it probably will be easier to write your own code. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10137#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler