[GHC] #4962: Dead code fed to CorePrep because RULEs keep it alive spuriously
GHC
cvs-ghc at haskell.org
Fri Feb 18 11:08:50 CET 2011
#4962: Dead code fed to CorePrep because RULEs keep it alive spuriously
---------------------------------+------------------------------------------
Reporter: batterseapower | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.0.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: Runtime performance bug
---------------------------------+------------------------------------------
Comment(by simonpj):
OK, here's a refined plan
* In `CorePrep.cloneBndr`, drop all unfoldings or rules
* In `CorePrep.deFloatTop`, which is the bit right at the end of
`CorePrep`, do `occurAnalyseExpr` on the RHS of each top-level binding.
The second step will just drop ''local'' dead let-bindings which are the
ones you want to drop. For that, it's fine for the top level Ids to be
`GlobalId`s.
I think you are right that local bindings don't currently retain their
RUES in `CoreTidy`, but I think that's ok. It would only matter in a
function that was going to be inlined. But if it's small enough to be
inlined, it's not going to be big enough to have interesting
specialisations on local let-bindings.
The reason we keep INLINE unfoldings is that Roman does write INLINE
pragmas whose RHS has a local binding with an INLINE pragma. If he wrote
local bindings with RULEs I'd have to retract the previous para -- but we
have no way to write RULES for local defns (yet)!
Do you feel like trying this out?
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4962#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list