[GHC] #9718: Avoid TidyPgm predicting what CorePrep will do
GHC
ghc-devs at haskell.org
Mon Dec 3 08:46:13 UTC 2018
#9718: Avoid TidyPgm predicting what CorePrep will do
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: (none)
Type: task | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.3
Resolution: | Keywords: CodeGen, CAFs
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 osa1):
I now built GHC with some debug prints to see what's going on. Here are
some
numbers:
- The new analysis never returns `MayHaveCafRefs` for a binder that
previous
passes assigned `NoCafRefs`.
- There are 9604 binders for which the new analysis returned `NoCafRefs`,
but
they were assigned `MayHaveCafRefs` by previous passes.
I looked at a few of the definitions that were assigned `NoCafRefs` by the
new
analysis but were previously `MayHaveCafRefs`. Here are a few examples:
(see also
the example in comment:19)
----
utils/hpc/HpcMarkup.hs:
{{{
sat_s7Je :: GHC.Types.Int
[LclId] =
CCS_DONT_CARE GHC.Types.I#! [68#];
}}}
(I don't know why this was previously `MayHaveCafRefs`)
----
libraries/base/GHC/Conc/Sync.hs
{{{
sat_s8GJ
:: forall a.
GHC.Conc.Sync.STM a -> GHC.Conc.Sync.STM a -> GHC.Conc.Sync.STM a
[LclId] =
\r [eta_B3 eta_B2 void_0E]
catchRetry# [eta_B3 eta_B2 GHC.Prim.void#];
}}}
This itself is not a CAF. Only free variable is `GHC.Prim.void#` (we don't
consider `catchRetry#` as a free variable because it's a primop) which is
defined like this
{{{
voidPrimId = pcMiscPrelId voidPrimIdName voidPrimTy
(noCafIdInfo `setUnfoldingInfo` evaldUnfolding -- Note
[evaldUnfoldings]
`setNeverLevPoly` voidPrimTy)
}}}
So this is not CAFFY (again, I don't know why this was previously
`MayHaveCafRefs`).
----
I also checked a few other definitions, one interesting binder that was
previously `MayHaveCafRefs` and is now `NoCafRefs` is this foreign import:
{{{
foreign import ccall unsafe "static stdlib.h &free" c_free_finalizer
:: FunPtr (Ptr Word8 -> IO ())
}}}
Once again I have no idea why this was previously `MayHaveCafRefs`...
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9718#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list