[GHC] #12603: INLINE and manually inlining produce different code
GHC
ghc-devs at haskell.org
Fri Oct 21 12:45:32 UTC 2016
#12603: INLINE and manually inlining produce different code
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: bgamari
Type: task | Status: new
Priority: normal | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
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 MikolajKonarski):
> I think that's very problematic. Currently GHC decides on a call-site-
by-call-site basis whether to inline a given function.[...]
When there is only one call site, IMHO it's reasonable that the outcome
should be reproducible with either INLINE or NOINLINE (and it is not
currently, see above).
> INLINE/NOINLINE let you take control; otherwise you are letting GHC
decide.
I'm all for letting GHC outsmart me, but I'd like to be able to then fix
the result GHC came up with and tweak it further or tweak other bits of
code, keeping this part constant, or stick to it in order to debug my
program with slightly varying other portions of code or easily come up
with a minimized example for a GHC bug, without GHC sneakily intefering.
Currently I can't. Let's move the discussion to
https://ghc.haskell.org/trac/ghc/ticket/12747#ticket where I also suggest
that INLINABLE+inline+noinline should let the programmer reproduce GHC
choices in the multi-call-site case.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12603#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list