[GHC] #13523: Be more explicit in generated case alternatives
GHC
ghc-devs at haskell.org
Tue Apr 4 15:38:29 UTC 2017
#13523: Be more explicit in generated case alternatives
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: feature | Status: new
request |
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
This came up during the GHC call while discussing #13397 and I thought it
would be good to record.
Often in the compiler we end up with a case analysis with a number of
alternatives and a `DEFAULT` case in place of the remaining alternative,
{{{!#hs
case x of
True -> a
DEFAULT -> b
}}}
Arguably we should instead generate,
{{{
case x of
True -> a
False -> b
}}}
instead as this may allow the code generator may be able to emit better
code when it knows the finite bounds of the switch (e.g. using a jump
table).
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13523>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list