summaryrefslogtreecommitdiff
path: root/compiler/llvmGen
diff options
context:
space:
mode:
authorGeoffrey Mainland <gmainlan@microsoft.com>2013-01-16 16:06:48 +0000
committerGeoffrey Mainland <gmainlan@microsoft.com>2013-02-01 22:00:24 +0000
commitb39e4de19a0aa3cbc42d72a02f83cec77f48f3a0 (patch)
treed665f392023a04c2ffcaf8a609c77ec057141984 /compiler/llvmGen
parentcc56f34e71201e27e4e15af01a5a6258648d6a32 (diff)
downloadhaskell-b39e4de19a0aa3cbc42d72a02f83cec77f48f3a0.tar.gz
Mimic OldCmm basic block ordering in the LLVM backend.
In OldCmm, the false case of a conditional was a fallthrough. In Cmm, conditionals have both true and false successors. When we convert Cmm to LLVM, we now first re-order Cmm blocks so that the false successor of a conditional occurs next in the list of basic blocks, i.e., it is a fallthrough, just like it (necessarily) did in OldCmm. Surprisingly, this can make a big performance difference.
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r--compiler/llvmGen/LlvmCodeGen/CodeGen.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
index 609be3d3b0..915981752e 100644
--- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
@@ -40,7 +40,7 @@ type LlvmStatements = OrdList LlvmStatement
--
genLlvmProc :: LlvmEnv -> RawCmmDecl -> UniqSM (LlvmEnv, [LlvmCmmDecl])
genLlvmProc env (CmmProc infos lbl live graph) = do
- let blocks = toBlockListEntryFirst graph
+ let blocks = toBlockListEntryFirstFalseFallthrough graph
(env', lmblocks, lmdata) <- basicBlocksCodeGen env live blocks ([], [])
let info = mapLookup (g_entry graph) infos
proc = CmmProc info lbl live (ListGraph lmblocks)