Go to file
Chandler Carruth bd1be4d01c Completely re-write the algorithm behind MachineBlockPlacement based on
discussions with Andy. Fundamentally, the previous algorithm is both
counter productive on several fronts and prioritizing things which
aren't necessarily the most important: static branch prediction.

The new algorithm uses the existing loop CFG structure information to
walk through the CFG itself to layout blocks. It coalesces adjacent
blocks within the loop where the CFG allows based on the most likely
path taken. Finally, it topologically orders the block chains that have
been formed. This allows it to choose a (mostly) topologically valid
ordering which still priorizes fallthrough within the structural
constraints.

As a final twist in the algorithm, it does violate the CFG when it
discovers a "hot" edge, that is an edge that is more than 4x hotter than
the competing edges in the CFG. These are forcibly merged into
a fallthrough chain.

Future transformations that need te be added are rotation of loop exit
conditions to be fallthrough, and better isolation of cold block chains.
I'm also planning on adding statistics to model how well the algorithm
does at laying out blocks based on the probabilities it receives.

The old tests mostly still pass, and I have some new tests to add, but
the nested loops are still behaving very strangely. This almost seems
like working-as-intended as it rotated the exit branch to be
fallthrough, but I'm not convinced this is actually the best layout. It
is well supported by the probabilities for loops we currently get, but
those are pretty broken for nested loops, so this may change later.

llvm-svn: 142743
2011-10-23 09:18:45 +00:00
clang Reduce dependencies. 2011-10-23 08:38:37 +00:00
compiler-rt <rdar://problem/10172492> No armv4t slice of libcompiler_rt-static.a 2011-09-27 20:05:27 +00:00
debuginfo-tests Testcase for r133065 2011-06-15 17:57:23 +00:00
libcxx More windows port work by Ruben Van Boxem 2011-10-22 20:59:45 +00:00
libcxxabi reformatted to match Clang style; thanks to John McCall for the nudge 2011-08-15 18:06:47 +00:00
lldb Bumped versions for lldb-81 and debugserver-146. 2011-10-22 03:38:38 +00:00
llvm Completely re-write the algorithm behind MachineBlockPlacement based on 2011-10-23 09:18:45 +00:00
polly ScopInfo: Fix ctx->ref != 0 problem 2011-10-17 08:32:36 +00:00