Go to file
Hans Wennborg 6ed81cbcdb Switch lowering: add heuristic for filling leaf nodes in the weight-balanced binary search tree
Sparse switches with profile info are lowered as weight-balanced BSTs. For
example, if the node weights are {1,1,1,1,1,1000}, the right-most node would
end up in a tree by itself, bringing it closer to the top.

However, a leaf in this BST can contain up to 3 cases, and having a single
case in a leaf node as in the example means the tree might become
unnecessarily high.

This patch adds a heauristic to the pivot selection algorithm that moves more
cases into leaf nodes unless that would lower their rank. It still doesn't
yield the optimal tree in every case, but I believe it's conservatibely correct.

llvm-svn: 240224
2015-06-20 17:14:07 +00:00
clang Avoid clearing an empty PrioritizedCXXGlobalInits, NFC 2015-06-20 15:51:52 +00:00
clang-tools-extra clang-tidy: Remove an unused private field. NFC 2015-06-18 04:15:04 +00:00
compiler-rt Add -flto to clang flags for cfi tests. 2015-06-19 19:48:40 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Use a more accurate implementation for exp 2015-05-13 03:55:09 +00:00
libcxx Fix illegal chars that snuck into <memory> 2015-06-19 19:32:06 +00:00
libcxxabi fallback_malloc: silence conversion warning (NFC) 2015-06-03 17:25:35 +00:00
libunwind Code cleanup: Reindent statements. 2015-05-30 14:00:39 +00:00
lld COFF: Fix common symbol alignment. 2015-06-20 07:25:45 +00:00
lldb Fix the MacOSX build to include the Mips64 ABI plug-in. 2015-06-19 20:08:36 +00:00
llgo [llgo] cmd/llgoi: use line editor 2015-05-23 15:16:09 +00:00
llvm Switch lowering: add heuristic for filling leaf nodes in the weight-balanced binary search tree 2015-06-20 17:14:07 +00:00
openmp Have CMake error out on Windows when user wants OMPT support 2015-06-17 15:43:34 +00:00
polly Fix the clang -Werror build (-Wbraced-scalar-init) 2015-06-19 20:07:18 +00:00