summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/X86
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/nativeGen/X86
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/nativeGen/X86')
-rw-r--r--compiler/nativeGen/X86/CodeGen.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs
index 26df11cd73..d582b53f5a 100644
--- a/compiler/nativeGen/X86/CodeGen.hs
+++ b/compiler/nativeGen/X86/CodeGen.hs
@@ -177,9 +177,10 @@ stmtToInstrs stmt = do
-> genCCall dflags is32Bit target result_regs args
CmmBranch id -> genBranch id
- CmmCondBranch arg true false -> do b1 <- genCondJump true arg
- b2 <- genBranch false
- return (b1 `appOL` b2)
+ CmmCondBranch arg true false _ -> do
+ b1 <- genCondJump true arg
+ b2 <- genBranch false
+ return (b1 `appOL` b2)
CmmSwitch arg ids -> do dflags <- getDynFlags
genSwitch dflags arg ids
CmmCall { cml_target = arg