id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
4428	Local functions lose their unfoldings	rl		"I'm attaching 2 modules, both should be compiled with -O2. Let's look at the inteface of `Foo`:

{{{
  foo :: (GHC.Types.Int, GHC.Types.Int)
         -> [GHC.Types.Int]
         -> [GHC.Types.Int]
    {- Arity: 2, Strictness: U(U(L)U(L))L, Inline: INLINE (sat-args=2),
       Unfolding: InlineRule (2, False, False)
                  (\ ds :: (GHC.Types.Int, GHC.Types.Int) xs :: [GHC.Types.Int] ->
                   case @ [GHC.Types.Int] ds of wild { (i, n) ->
                   let {
                     step :: forall t.
                             ([t], GHC.Types.Int, GHC.Types.Int)
                             -> Data.Maybe.Maybe (([t], GHC.Types.Int, GHC.Types.Int), t)
                       {- Inline: INLINE[0] (sat-args=1) -}
                     = ...

}}}

Note how `step`, which is local to `foo`, has an `INLINE` pragma but no unfolding. Now, let's look at `Bar`. For some reason, GHC only inlines `foo` into `bar` in phase 1. This is probably unrelated but still surprising. The main problem, though, is that `step`, not having an unfolding, doesn't get inlined at all despite the `INLINE` pragma. "	bug	new	low	7.6.2	Compiler	7.1				Unknown/Multiple	Unknown/Multiple	Runtime performance bug					
