llvm-project/llvm/lib
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
..
Analysis [CallGraph] Given -print-callgraph a stable printing order. 2015-06-19 23:20:31 +00:00
AsmParser Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
Bitcode Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
CodeGen Switch lowering: add heuristic for filling leaf nodes in the weight-balanced binary search tree 2015-06-20 17:14:07 +00:00
DebugInfo Try to fix generation of LLVMExports.cmake under Visual Studio. 2015-06-19 21:50:27 +00:00
ExecutionEngine [MCJIT] Add a FindGlobalVariableNamed utility 2015-06-20 00:55:58 +00:00
Fuzzer [lib/Fuzzer] make assertions more informative and update comments for the user-supplied mutator 2015-05-30 17:33:13 +00:00
IR Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
IRReader Return a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC. 2015-06-16 22:27:55 +00:00
LTO Return a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC. 2015-06-16 22:27:55 +00:00
LibDriver LibDriver: implement /libpath and $LIB; ignore /ignore and /machine. 2015-06-20 00:57:12 +00:00
LineEditor Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects. 2015-02-11 03:28:02 +00:00
Linker Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
MC Update ELFObjectWriter::reset() following r238073. 2015-06-20 11:54:32 +00:00
Object Make getRelocationSection MachO only. 2015-06-19 17:54:28 +00:00
Option Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
Passes [PM] Fixup for r231556 where I missed a dependency on intrinsics 2015-03-07 09:08:20 +00:00
ProfileData Revert "InstrProf: When reading, copy the data instead of taking a reference. NFC" 2015-06-20 01:37:56 +00:00
Support Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
TableGen Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
Target [X86][SSE] Fix PerformSExtCombine bug that accessed the wrong return value of an aggregate type. 2015-06-20 16:19:24 +00:00
Transforms [SwitchLowering] Remove quadratic vector removal. 2015-06-20 15:59:34 +00:00
CMakeLists.txt LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00
LLVMBuild.txt Wrap some long lines in LLVMBuild files. NFC 2015-06-12 18:44:57 +00:00
Makefile LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00