[GHC] #9370: unfolding info as seen when building a module depends on flags in a previously-compiled module
GHC
ghc-devs at haskell.org
Thu Sep 15 16:57:05 UTC 2016
#9370: unfolding info as seen when building a module depends on flags in a
previously-compiled module
-------------------------------------+-------------------------------------
Reporter: carter | Owner: richardfung
Type: bug | Status: new
Priority: high | Milestone: 8.2.1
Component: Compiler | Version: 7.8.3
Resolution: | Keywords: newcomer,
| Inlining
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: #8635 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by richardfung):
Ah yes sorry I shall try to keep my comments more self contained.
The ticket addresses the issue that the unfolding info seen depends on
previously compiled modules with --make. As I understand it, this can
either cause ghc to inline when it shouldn't (in -O0) or to be unable to
inline when it should.
For example, if we have modules A and B, both which import module C, and
we assume A is built first, then whether B sees the interface pragmas of C
is dependent on whether they were read in when compiling A. If A is built
with -O0, then even if B is built with -O it can not inline things from C
because it doesn't have the unfolding info. Alternatively, if A is built
with -O and B is built with -O0, B will still see the unfolding info and
use it.
The suggested fix is to disable -fignore-interface-pragmas being implied
by -O0 and to make sm_inline = False when -O0.
I do believe this solves both of the scenarios described above, but I'm
concerned that if A is built with -fignore-interface-pragmas, and B is
built with -O, B will still not have the unfolding info from C when
compiling. This would be identical to what's currently happening when A is
built with -O0 and B with -O.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9370#comment:38>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list