[GHC] #16039: 'GHC.Magic.noinline <var>' should not float out
GHC
ghc-devs at haskell.org
Thu Dec 13 15:35:44 UTC 2018
#16039: 'GHC.Magic.noinline <var>' should not float out
-------------------------------------+-------------------------------------
Reporter: heisenbug | Owner: heisenbug
Type: bug | Status: new
Priority: normal | Milestone: 8.8.1
Component: Compiler | Version: 8.2.1
Resolution: | Keywords: FloatOut
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #15155 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
I think the underlying point is that you want `(noinline f)` to be treated
very like `f`, for many purposes. Because it'll turn ''into'' `f` in
`CorePrep`.
Particularly, I think you want `exprIsTrivial` to be true of it. So maybe
instead of
{{{
exprIsTrivial (App e arg) = not (isRuntimeArg arg) && exprIsTrivial e
}}}
you want
{{{
exprIsTrivial (App e arg)
| not (isRuntimeArg arg)
= exprIsTrivial e
| App (Var f) _ <- e, isInlineId f
= exprIsTrivial arg
| otherwise
= False
}}}
Not very nice, and it's possible that other functions may need similar
treatment. But nothing better jumps out at me.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16039#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list