[GHC] #14137: Do more inlining into non-recursive join points

GHC ghc-devs at haskell.org
Fri Aug 18 13:55:42 UTC 2017


#14137: Do more inlining into non-recursive join points
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  nomeata
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  JoinPoints
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by nomeata):

 I get an trac error when attaching files, so here it is:
 {{{
 module T14137 where
 foo x ds4 n = safe x ds4
   where
   ds5 :: [[Int]]
   ds5 = if x == 0 then foo (x-1) ds4 n else n

   lvl6 :: [[Int]]
   lvl6 = (x : ds4) : ds5

   safe :: Int -> [Int] -> [[Int]]
   safe x2 ds6
     = case ds6 of
         [] -> lvl6;
         q : l | x2     == q -> ds5
               | x2 + 1 == q -> ds5
               | x2 + 2 == q -> ds5
               | x2 + 3 == q -> ds5
               | otherwise   -> safe (x+10) l
 }}}
 (I did not simply create a test case directly because I need to see the
 actualy, desired output in order to write the check.)

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


More information about the ghc-tickets mailing list