summaryrefslogtreecommitdiff
path: root/compiler/nativeGen
diff options
context:
space:
mode:
authorklebinger.andreas@gmx.at <klebinger.andreas@gmx.at>2018-01-26 13:06:50 -0500
committerBen Gamari <ben@smart-cactus.org>2018-01-26 14:37:28 -0500
commit52dfb25c400bf1225132fdb8d7c25fa385c8ae3f (patch)
tree96648ef0605bcd0ad5c8e332964881b077a4d525 /compiler/nativeGen
parent302aee52b61b754267c48465e94683f4aeda3fe8 (diff)
downloadhaskell-52dfb25c400bf1225132fdb8d7c25fa385c8ae3f.tar.gz
Handle the likely:True case in CmmContFlowOpt
It's better to fall through to the likely case than to jump to it. We optimize for this in CmmContFlowOpt when likely:False. This commit extends the logic there to handle cases with likely:True as well. Test Plan: ci Reviewers: bgamari, simonmar Reviewed By: bgamari Subscribers: simonmar, alexbiehl, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4306
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r--compiler/nativeGen/X86/CodeGen.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs
index eb6af1ff41..09757e769e 100644
--- a/compiler/nativeGen/X86/CodeGen.hs
+++ b/compiler/nativeGen/X86/CodeGen.hs
@@ -210,6 +210,9 @@ stmtToInstrs stmt = do
-> genCCall dflags is32Bit target result_regs args
CmmBranch id -> genBranch id
+
+ --We try to arrange blocks such that the likely branch is the fallthrough
+ --in CmmContFlowOpt. So we can assume the condition is likely false here.
CmmCondBranch arg true false _ -> do
b1 <- genCondJump true arg
b2 <- genBranch false