Mimic OldCmm basic block ordering in the LLVM backend.
authorGeoffrey Mainland <gmainlan@microsoft.com>
Wed, 16 Jan 2013 16:06:48 +0000 (16:06 +0000)
committerGeoffrey Mainland <gmainlan@microsoft.com>
Fri, 1 Feb 2013 22:00:24 +0000 (22:00 +0000)
commitb39e4de19a0aa3cbc42d72a02f83cec77f48f3a0
treed665f392023a04c2ffcaf8a609c77ec057141984
parentcc56f34e71201e27e4e15af01a5a6258648d6a32
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.
compiler/cmm/CmmUtils.hs
compiler/llvmGen/LlvmCodeGen/CodeGen.hs