[GHC] #12150: Compile time performance degradation on code that uses undefined/error with CallStacks
GHC
ghc-devs at haskell.org
Wed Jul 19 16:33:28 UTC 2017
#12150: Compile time performance degradation on code that uses undefined/error with
CallStacks
-------------------------------------+-------------------------------------
Reporter: thomie | Owner: (none)
Type: bug | Status: new
Priority: high | Milestone: 8.2.2
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: #10844 | Differential Rev(s): Phab:D3753
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
> For some reason, we're not eliminating the ...
I assume this is just in the ''first'' simplifier run, when `case-of-case`
is off? In the second simplifier run, the `case` gets eliminated,
correct?
I know why this is. In `Simplify` we have:
{{{
simplExprF1 env (Case scrut bndr _ alts) cont
| sm_case_case (getMode env)
= simplExprF env scrut (Select { sc_dup = NoDup, sc_bndr = bndr
, sc_alts = alts
, sc_env = env, sc_cont = cont })
| otherwise
= do { (env', scrut') <- simplExprF (zapFloats env) scrut $
mkBoringStop (substTy env (idType bndr))
; let scrut'' = wrapJoinFloats (seJoinFloats env') scrut'
env'' = env `addLetFloats` env'
; rebuildCase env'' scrut'' bndr alts cont }
}}}
That is, if `case-of-case` is off, we simplify the scrutinee in a trivial
continuation, and then wrap the alternatives around it. So disabling
case-of-case has also disabled case-of-bottom. I did this fairly
recently, which accounts for the change.
Let me think about a better way.
Meanwhile you are working on that `botSig` stuff, making it work with
functions too, right?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12150#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list