diff options
Diffstat (limited to 'compiler/stgSyn/StgSyn.hs')
-rw-r--r-- | compiler/stgSyn/StgSyn.hs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/compiler/stgSyn/StgSyn.hs b/compiler/stgSyn/StgSyn.hs index 29d544103f..3f7cbc0f46 100644 --- a/compiler/stgSyn/StgSyn.hs +++ b/compiler/stgSyn/StgSyn.hs @@ -47,6 +47,7 @@ module StgSyn ( import GhcPrelude +import BasicTypes (BranchWeight) import CoreSyn ( AltCon, Tickish ) import CostCentre ( CostCentreStack ) import Data.ByteString ( ByteString ) @@ -479,7 +480,7 @@ rhsHasCafRefs (StgRhsCon _ _ args) = any stgArgHasCafRefs args altHasCafRefs :: GenStgAlt bndr Id -> Bool -altHasCafRefs (_, _, rhs) = exprHasCafRefs rhs +altHasCafRefs (_, _, rhs, _) = exprHasCafRefs rhs stgArgHasCafRefs :: GenStgArg Id -> Bool stgArgHasCafRefs (StgVarArg id) @@ -543,7 +544,9 @@ rather than from the scrutinee type. type GenStgAlt bndr occ = (AltCon, -- alts: data constructor, [bndr], -- constructor's parameters, - GenStgExpr bndr occ) -- ...right-hand side. + GenStgExpr bndr occ, -- ..right-hand side, + BranchWeight) -- relative chance to take this alt, see + -- Note [Branch weights] in BasicTypes data AltType = PolyAlt -- Polymorphic (a lifted type variable) @@ -784,8 +787,11 @@ pprStgExpr (StgCase expr bndr alt_type alts) pprStgAlt :: (OutputableBndr bndr, Outputable occ, Ord occ) => GenStgAlt bndr occ -> SDoc -pprStgAlt (con, params, expr) - = hang (hsep [ppr con, sep (map (pprBndr CasePatBind) params), text "->"]) +pprStgAlt (con, params, expr, f) + = hang (hsep [ppr con, + sep (map (pprBndr CasePatBind) params), + parens (text "likely:" <> ppr f) , + text "->"]) 4 (ppr expr <> semi) pprStgOp :: StgOp -> SDoc |