1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/test
Hans Wennborg bc33cd14d7 Switch lowering: extract jump tables and bit tests before building binary tree (PR22262)
This is a major rewrite of the SelectionDAG switch lowering. The previous code
would lower switches as a binary tre, discovering clusters of cases
suitable for lowering by jump tables or bit tests as it went along. To increase
the likelihood of finding jump tables, the binary tree pivot was selected to
maximize case density on both sides of the pivot.

By not selecting the pivot in the middle, the binary trees would not always
be balanced, leading to performance problems in the generated code.

This patch rewrites the lowering to search for clusters of cases
suitable for jump tables or bit tests first, and then builds the binary
tree around those clusters. This way, the binary tree will always be balanced.

This has the added benefit of decoupling the different aspects of the lowering:
tree building and jump table or bit tests finding are now easier to tweak
separately.

For example, this will enable us to balance the tree based on profile info
in the future.

The algorithm for finding jump tables is O(n^2), whereas the previous algorithm
was O(n log n) for common cases, and quadratic only in the worst-case. This
doesn't seem to be major problem in practice, e.g. compiling a file consisting
of a 10k-case switch was only 30% slower, and such large switches should be rare
in practice. Compiling e.g. gcc.c showed no compile-time difference.  If this
does turn out to be a problem, we could limit the search space of the algorithm.

This commit also disables all optimizations during switch lowering in -O0.

Differential Revision: http://reviews.llvm.org/D8649

llvm-svn: 235101
2015-04-16 14:49:23 +00:00
..
Analysis Re-apply r234898 and fix tests. 2015-04-15 06:24:07 +00:00
Assembler DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable 2015-04-15 22:29:27 +00:00
Bindings
Bitcode Revert "Verify sizes when trying to read a VBR" 2015-04-15 11:10:17 +00:00
BugPoint bugpoint: Verify input files 2015-03-26 05:03:10 +00:00
CodeGen Switch lowering: extract jump tables and bit tests before building binary tree (PR22262) 2015-04-16 14:49:23 +00:00
DebugInfo DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable 2015-04-15 22:29:27 +00:00
ExecutionEngine [RuntimeDyld] Make sure we emit MachO __eh_frame and __gcc_except_tab sections, 2015-04-15 03:39:22 +00:00
Feature Rewrite test/Feature/md_on_instruction.ll 2015-03-20 18:34:53 +00:00
FileCheck
Instrumentation [ASan] Don't use stack malloc for 32-bit functions using inline asm 2015-04-02 21:44:55 +00:00
Integer [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
JitListener
Linker tools: Unify how verifyModule() is called 2015-03-31 03:07:23 +00:00
LTO libLTO, llvm-lto, gold: Introduce flag for controlling optimization level. 2015-03-19 22:01:00 +00:00
MC Switch lowering: extract jump tables and bit tests before building binary tree (PR22262) 2015-04-16 14:49:23 +00:00
Object [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
Other [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
SymbolRewriter
TableGen [TableGen] Prevent invalid code generation when emitting AssemblerPredicate conditions. 2015-04-07 12:10:11 +00:00
tools llvm-readobj: teach it to handle MachO Universal Archive correctly 2015-04-13 16:05:49 +00:00
Transforms DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable 2015-04-15 22:29:27 +00:00
Unit
Verifier Verifier: Check that @llvm.dbg.* intrinsics have a !dbg attachment 2015-04-15 22:15:46 +00:00
YAMLParser
.clang-format
CMakeLists.txt test: Fix the dependencies for the check-llvm-* targets 2015-03-25 08:07:47 +00:00
lit.cfg Tell lit.cfg about more Windows triples. 2015-03-20 22:08:40 +00:00
lit.site.cfg.in test: Make a start on a test suite for libLTO. 2015-03-19 23:55:38 +00:00
Makefile test: Make a start on a test suite for libLTO. 2015-03-19 23:55:38 +00:00
Makefile.tests
TestRunner.sh