Annotate CmmBranch with an optional likely target
authorSimon Marlow <marlowsd@gmail.com>
Mon, 21 Sep 2015 08:14:33 +0000 (09:14 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 23 Sep 2015 13:07:44 +0000 (14:07 +0100)
commit939a7d6367501d43be73f4e41db7395af1194989
treee915a6cc270fca5e0b4c803b38e5467f9f4d61c3
parent65bf7baa81772b7f07a4c74d3510dbd2ef03592d
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
20 files changed:
compiler/cmm/CmmCommonBlockElim.hs
compiler/cmm/CmmContFlowOpt.hs
compiler/cmm/CmmImplementSwitchPlans.hs
compiler/cmm/CmmLayoutStack.hs
compiler/cmm/CmmLint.hs
compiler/cmm/CmmNode.hs
compiler/cmm/CmmParse.y
compiler/cmm/CmmProcPoint.hs
compiler/cmm/MkGraph.hs
compiler/cmm/PprC.hs
compiler/cmm/PprCmm.hs
compiler/codeGen/StgCmmExpr.hs
compiler/codeGen/StgCmmLayout.hs
compiler/codeGen/StgCmmMonad.hs
compiler/codeGen/StgCmmUtils.hs
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
compiler/nativeGen/AsmCodeGen.hs
compiler/nativeGen/PPC/CodeGen.hs
compiler/nativeGen/SPARC/CodeGen.hs
compiler/nativeGen/X86/CodeGen.hs