1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/test
James Molloy d32f0cec9f [Thumb] Teach ISel how to lower compares of AND bitmasks efficiently
This recommits r281323, which was backed out for two reasons. One, a selfhost failure, and two, it apparently caused Chromium failures. Actually, the latter was a red herring. The log has expired from the former, but I suspect that was a red herring too (actually caused by another problematic patch of mine). Therefore reapplying, and will watch the bots like a hawk.

For the common pattern (CMPZ (AND x, #bitmask), #0), we can do some more efficient instruction selection if the bitmask is one consecutive sequence of set bits (32 - clz(bm) - ctz(bm) == popcount(bm)).

1) If the bitmask touches the LSB, then we can remove all the upper bits and set the flags by doing one LSLS.
2) If the bitmask touches the MSB, then we can remove all the lower bits and set the flags with one LSRS.
3) If the bitmask has popcount == 1 (only one set bit), we can shift that bit into the sign bit with one LSLS and change the condition query from NE/EQ to MI/PL (we could also implement this by shifting into the carry bit and branching on BCC/BCS).
4) Otherwise, we can emit a sequence of LSLS+LSRS to remove the upper and lower zero bits of the mask.

1-3 require only one 16-bit instruction and can elide the CMP. 4 requires two 16-bit instructions but can elide the CMP and doesn't require materializing a complex immediate, so is also a win.

llvm-svn: 285893
2016-11-03 10:18:20 +00:00
..
Analysis Improved cost model for FDIV and FSQRT, by Andrew Tischenko 2016-10-31 12:10:53 +00:00
Assembler DebugInfo: preparation to implement DW_AT_alignment 2016-10-20 00:13:12 +00:00
Bindings
Bitcode Bitcode: Check file size before reading bitcode header. 2016-11-02 00:39:11 +00:00
BugPoint Add -strip-nonlinetable-debuginfo capability 2016-10-25 18:44:13 +00:00
CodeGen [Thumb] Teach ISel how to lower compares of AND bitmasks efficiently 2016-11-03 10:18:20 +00:00
DebugInfo Emit S_COMPILE3 record once per TU rather than once per function 2016-11-02 21:30:35 +00:00
Demangle
Examples
ExecutionEngine [RuntimeDyld] Move an X86 only test to the correct directory. 2016-11-02 21:05:42 +00:00
Feature
FileCheck
Instrumentation [asan] Move instrumented null-terminated strings to a special section, LLVM part 2016-10-31 18:51:58 +00:00
Integer
JitListener
LibDriver
Linker
LTO
MC Emit S_COMPILE3 record once per TU rather than once per function 2016-11-02 21:30:35 +00:00
Object Add the rest of the additional error checks for invalid Mach-O files when 2016-11-02 21:08:39 +00:00
ObjectYAML
Other [lit] Work around Windows MSys command line tokenization bug 2016-10-26 20:29:27 +00:00
SymbolRewriter
TableGen
ThinLTO/X86 [ThinLTO] Handle distributed backend case when doing renaming 2016-11-03 01:07:16 +00:00
tools Add the rest of the additional error checks for invalid Mach-O files when 2016-11-02 21:08:39 +00:00
Transforms Revert "[InstCombine] allow splat vector folds in adjustMinMax()" 2016-11-02 23:17:05 +00:00
Unit
Verifier
YAMLParser
.clang-format
CMakeLists.txt [XRay] Add llvm-xray as a dependency to test/CMakeLists.txt 2016-10-26 04:16:05 +00:00
lit.cfg [XRay] Implement llvm-xray extract, start of the llvm-xray tool 2016-10-26 04:14:34 +00:00
lit.site.cfg.in
TestRunner.sh