[GHC] #14951: SpecContsr needs two runs when one should suffice

GHC ghc-devs at haskell.org
Tue Mar 20 22:18:41 UTC 2018


#14951: SpecContsr needs two runs when one should suffice
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:  SpecConstr
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14844            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 > So can we, at this point, decide to include t0 ↦ ScrutOcc in scu_occs?

 I'm not at all sure.  There might be many specialisations of `l`, with
 many RULES.  Which of them would you like to use when gathering occurrence
 info `foo`'s argument.

 Sebastian's thought is interesting though.  Perhaps we want the fact that
 `l`'s argument is scrutinesed to flow from `l` to `l`'s call sites, via
 some kind of !SpecConstr signature.  It might be as if we'd inlined one
 "layer" of `l` at the call site.

 I wonder about fixpointing such signatures. Consider
 {{{
 f True x y = case x of (p,q) -> ...
 f False x y = f True y x
 }}}
 We'd get a specialisation for `x`, but (I think) not for `y`.   But one
 for `y` would be good!

 !SpecConstr is jolly compilicated.  Splitting it into an analysis followed
 by exploitation woudl be a good thing.  Just like demand analysis.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14951#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list