[commit: ghc] master: Add a work-around for #7978. (bdc3775)

Geoffrey Mainland gmainlan at microsoft.com
Sat Jun 22 21:25:45 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/bdc3775aa29accfdcd106a1003aa1d598609c28c

>---------------------------------------------------------------

commit bdc3775aa29accfdcd106a1003aa1d598609c28c
Author: Geoffrey Mainland <gmainlan at microsoft.com>
Date:   Sat Jun 22 20:23:24 2013 +0100

    Add a work-around for #7978.
    
    This patch fixes profiling at the cost of losing cost centre accounting in a
    very small number of cases. I am working on a better fix.

>---------------------------------------------------------------

 compiler/codeGen/StgCmmBind.hs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/compiler/codeGen/StgCmmBind.hs b/compiler/codeGen/StgCmmBind.hs
index eb1bfe9..4996c6f 100644
--- a/compiler/codeGen/StgCmmBind.hs
+++ b/compiler/codeGen/StgCmmBind.hs
@@ -209,7 +209,7 @@ cgRhs id (StgRhsCon cc con args)
 
 cgRhs name (StgRhsClosure cc bi fvs upd_flag _srt args body)
   | null fvs   -- See Note [Nested constant closures]
-  = do { (info, fcode) <- cgTopRhsClosure Recursive name cc bi upd_flag args body 
+  = do { (info, fcode) <- cgTopRhsClosure Recursive name dontCareCCS bi upd_flag args body 
        ; return (info, fcode >> return mkNop) }
   | otherwise 
   = do dflags <- getDynFlags
@@ -234,7 +234,12 @@ False, which is fair enough.)
 
 Simple solution: compile the RHS as if it was top level.  Then
 everything works.  A minor benefit is eliminating the allocation code
-too.  -}
+too.
+
+GBM: when we compile the RHS as if it were top level, the cost centre stack in
+the StgRhsClosure is no longer valid. For now we replace the cost centre stack
+with dontCareCCS.
+-}
 
 ------------------------------------------------------------------------
 --              Non-constructor right hand sides





More information about the ghc-commits mailing list