[GHC] #7308: Better code for top-level indirections
GHC
cvs-ghc at haskell.org
Mon Nov 19 17:00:58 CET 2012
#7308: Better code for top-level indirections
---------------------------------+------------------------------------------
Reporter: simonpj | Owner: simonmar
Type: bug | Status: new
Priority: high | Milestone: 7.8.1
Component: Compiler | Version: 7.6.1
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by marlowsd@…):
commit 7da13762664c1bec8e2a1ee5c7106cca3b32a98f
{{{
Author: Simon Marlow <marlowsd at gmail.com>
Date: Tue Oct 9 08:49:25 2012 +0100
Code-size optimisation for top-level indirections (#7308)
Top-level indirections are often generated when there is a cast, e.g.
foo :: T
foo = bar `cast` (some coercion)
For these we were generating a full-blown CAF, which is a fair chunk
of code.
This patch makes these indirections generate a single IND_STATIC
closure (4 words) instead. This is exactly what the CAF would
evaluate to eventually anyway, we're just shortcutting the whole
process.
compiler/cmm/CmmInfo.hs | 3 +-
compiler/cmm/SMRep.lhs | 11 +++++++++-
compiler/codeGen/StgCmm.hs | 13 ++++++-----
compiler/codeGen/StgCmmBind.hs | 40
++++++++++++++++++++++++++++--------
compiler/codeGen/StgCmmClosure.hs | 8 +++++++
compiler/codeGen/StgCmmHeap.hs | 6 +---
6 files changed, 60 insertions(+), 21 deletions(-)
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7308#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list