summaryrefslogtreecommitdiff
path: root/compiler/cmm
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2008-11-18 14:24:42 +0000
committerSimon Marlow <marlowsd@gmail.com>2008-11-18 14:24:42 +0000
commitd600bf7a6afdbfc4a22f9379406a9c6f789a4c2d (patch)
treefc86da89b8891374298c441d14d2333b33e29d53 /compiler/cmm
parent0fa59deb44b8a1a0b44ee2b4cc4ae0db31dec038 (diff)
downloadhaskell-d600bf7a6afdbfc4a22f9379406a9c6f789a4c2d.tar.gz
Add optional eager black-holing, with new flag -feager-blackholing
Eager blackholing can improve parallel performance by reducing the chances that two threads perform the same computation. However, it has a cost: one extra memory write per thunk entry. To get the best results, any code which may be executed in parallel should be compiled with eager blackholing turned on. But since there's a cost for sequential code, we make it optional and turn it on for the parallel package only. It might be a good idea to compile applications (or modules) with parallel code in with -feager-blackholing. ToDo: document -feager-blackholing.
Diffstat (limited to 'compiler/cmm')
-rw-r--r--compiler/cmm/CLabel.hs5
-rw-r--r--compiler/cmm/CmmExpr.hs1
-rw-r--r--compiler/cmm/PprC.hs1
-rw-r--r--compiler/cmm/PprCmm.hs1
4 files changed, 3 insertions, 5 deletions
diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
index 0c3c007869..1c338243ab 100644
--- a/compiler/cmm/CLabel.hs
+++ b/compiler/cmm/CLabel.hs
@@ -63,7 +63,6 @@ module CLabel (
mkTopTickyCtrLabel,
mkCAFBlackHoleInfoTableLabel,
- mkSECAFBlackHoleInfoTableLabel,
mkRtsPrimOpLabel,
mkRtsSlowTickyCtrLabel,
@@ -348,10 +347,6 @@ mkEMPTY_MVAR_infoLabel = RtsLabel (RtsInfo (sLit "stg_EMPTY_MVAR"))
mkTopTickyCtrLabel = RtsLabel (RtsData (sLit "top_ct"))
mkCAFBlackHoleInfoTableLabel = RtsLabel (RtsInfo (sLit "stg_CAF_BLACKHOLE"))
-mkSECAFBlackHoleInfoTableLabel = if opt_DoTickyProfiling then
- RtsLabel (RtsInfo (sLit "stg_SE_CAF_BLACKHOLE"))
- else -- RTS won't have info table unless -ticky is on
- panic "mkSECAFBlackHoleInfoTableLabel requires -ticky"
mkRtsPrimOpLabel primop = RtsLabel (RtsPrimOp primop)
moduleRegdLabel = ModuleRegdLabel
diff --git a/compiler/cmm/CmmExpr.hs b/compiler/cmm/CmmExpr.hs
index 06149b490d..69a4952ed6 100644
--- a/compiler/cmm/CmmExpr.hs
+++ b/compiler/cmm/CmmExpr.hs
@@ -267,6 +267,7 @@ data GlobalReg
-- We keep the address of some commonly-called
-- functions in the register table, to keep code
-- size down:
+ | EagerBlackholeInfo -- stg_EAGER_BLACKHOLE_info
| GCEnter1 -- stg_gc_enter_1
| GCFun -- stg_gc_fun
diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
index 37359ed84b..2a01217803 100644
--- a/compiler/cmm/PprC.hs
+++ b/compiler/cmm/PprC.hs
@@ -748,6 +748,7 @@ pprGlobalReg gr = case gr of
CurrentNursery -> ptext (sLit "CurrentNursery")
HpAlloc -> ptext (sLit "HpAlloc")
BaseReg -> ptext (sLit "BaseReg")
+ EagerBlackholeInfo -> ptext (sLit "stg_EAGER_BLACKHOLE_info")
GCEnter1 -> ptext (sLit "stg_gc_enter_1")
GCFun -> ptext (sLit "stg_gc_fun")
diff --git a/compiler/cmm/PprCmm.hs b/compiler/cmm/PprCmm.hs
index dbfd20e424..e801aeee26 100644
--- a/compiler/cmm/PprCmm.hs
+++ b/compiler/cmm/PprCmm.hs
@@ -565,6 +565,7 @@ pprGlobalReg gr
CurrentTSO -> ptext (sLit "CurrentTSO")
CurrentNursery -> ptext (sLit "CurrentNursery")
HpAlloc -> ptext (sLit "HpAlloc")
+ EagerBlackholeInfo -> ptext (sLit "stg_EAGER_BLACKHOLE_info")
GCEnter1 -> ptext (sLit "stg_gc_enter_1")
GCFun -> ptext (sLit "stg_gc_fun")
BaseReg -> ptext (sLit "BaseReg")