[GHC] #13016: SPECIALIZE INLINE doesn't necessarily inline specializations of a recursive function

GHC ghc-devs at haskell.org
Sat May 13 22:12:08 UTC 2017


#13016: SPECIALIZE INLINE doesn't necessarily inline specializations of a recursive
function
-------------------------------------+-------------------------------------
        Reporter:  nfrisby           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  Inlining
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13014            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mpickering):

 I also confirmed that b61562feb87689a202118ca08ef270422c69dcc2 causes
 SpecConstr to fire on this example when it didn't before.

 Here is the snippet of the core which was produced *before* this patch.

 {{{
 T13016.exampleMODULE2 :: Arr (Int, Int)
 [GblId,
  Caf=NoCafRefs,
  Str=DmdType,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 T13016.exampleMODULE2 =
   T13016.ArrPair
     @ (Int, Int)
     @ Int
     @ Int
     @~ <(Int, Int)>_N
     T13016.exampleMODULE4
     T13016.exampleMODULE3

 T13016.exampleMODULE1 :: Int
 [GblId,
  Caf=NoCafRefs,
  Str=DmdType,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 T13016.exampleMODULE1 = I# 5#

 exampleMODULE :: (Int, Int)
 [GblId,
  Str=DmdType,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
          WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 50 30}]
 exampleMODULE =
   case T13016.$w$s!:
          @ Int @ Int T13016.exampleMODULE2 T13016.exampleMODULE1
   of _ [Occ=Dead] { (# ww1_sAJ, ww2_sAK #) ->
   (ww1_sAJ, ww2_sAK)
   }
 }}}

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


More information about the ghc-tickets mailing list