summaryrefslogtreecommitdiff
path: root/compiler/cmm/PprC.hs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2015-09-21 09:14:33 +0100
committerSimon Marlow <marlowsd@gmail.com>2015-09-23 14:07:44 +0100
commit939a7d6367501d43be73f4e41db7395af1194989 (patch)
treee915a6cc270fca5e0b4c803b38e5467f9f4d61c3 /compiler/cmm/PprC.hs
parent65bf7baa81772b7f07a4c74d3510dbd2ef03592d (diff)
downloadhaskell-939a7d6367501d43be73f4e41db7395af1194989.tar.gz
Annotate CmmBranch with an optional likely target
Summary: This allows the code generator to give hints to later code generation steps about which branch is most likely to be taken. Right now it is only taken into account in one place: a special case in CmmContFlowOpt that swapped branches over to maximise the chance of fallthrough, which is now disabled when there is a likelihood setting. Test Plan: validate Reviewers: austin, simonpj, bgamari, ezyang, tibbe Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1273
Diffstat (limited to 'compiler/cmm/PprC.hs')
-rw-r--r--compiler/cmm/PprC.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
index ee0680d3e9..c96b7076bf 100644
--- a/compiler/cmm/PprC.hs
+++ b/compiler/cmm/PprC.hs
@@ -249,7 +249,7 @@ pprStmt stmt =
= pprCall fn cconv hresults hargs
CmmBranch ident -> pprBranch ident
- CmmCondBranch expr yes no -> pprCondBranch expr yes no
+ CmmCondBranch expr yes no _ -> pprCondBranch expr yes no
CmmCall { cml_target = expr } -> mkJMP_ (pprExpr expr) <> semi
CmmSwitch arg ids -> sdocWithDynFlags $ \dflags ->
pprSwitch dflags arg ids
@@ -1042,7 +1042,7 @@ te_Stmt (CmmUnsafeForeignCall target rs es)
= do te_Target target
mapM_ te_temp rs
mapM_ te_Expr es
-te_Stmt (CmmCondBranch e _ _) = te_Expr e
+te_Stmt (CmmCondBranch e _ _ _) = te_Expr e
te_Stmt (CmmSwitch e _) = te_Expr e
te_Stmt (CmmCall { cml_target = e }) = te_Expr e
te_Stmt _ = return ()