1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Go to file
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
bindings [Go bindings] Update for r284678 API changes. 2016-10-20 09:14:39 +00:00
cmake [CMake] Disable rpath for UnitTests 2016-11-03 06:58:16 +00:00
docs [docs] Fix some typos. NFC. 2016-11-01 23:55:50 +00:00
examples Fix Clang-tidy readability-redundant-string-cstr warnings 2016-11-02 16:43:50 +00:00
include [Object/ELF] - Make getSymbol() return Error. 2016-11-03 08:40:55 +00:00
lib [Thumb] Teach ISel how to lower compares of AND bitmasks efficiently 2016-11-03 10:18:20 +00:00
projects [CMake] Correct configuration order of the sub-projects based on ther dependancies 2016-10-09 20:38:29 +00:00
resources
runtimes [CMake] Make the runtimes directory work with bootstrap builds 2016-10-19 21:50:25 +00:00
test [Thumb] Teach ISel how to lower compares of AND bitmasks efficiently 2016-11-03 10:18:20 +00:00
tools [tools/obj2yaml] - Update after LLVM change r285886 2016-11-03 08:41:46 +00:00
unittests [CMake] Disable rpath for UnitTests 2016-11-03 06:58:16 +00:00
utils Expandload and Compressstore intrinsics 2016-11-03 03:23:55 +00:00
.arcconfig project_id is from another era in phabricator land and does not provide any value. 2016-09-27 15:47:29 +00:00
.clang-format
.clang-tidy .clang-tidy: correct style name is 'camelBack' not 'lowerCase'. 2016-09-13 19:04:26 +00:00
.gitignore gitignore: ignore VS Code editor files 2016-09-02 22:54:26 +00:00
CMakeLists.txt [CMake] Set default build type correctly 2016-11-02 06:10:03 +00:00
CODE_OWNERS.TXT [RISCV] Add stub backend 2016-11-01 17:27:54 +00:00
configure
CREDITS.TXT Test Commit, removed extraneous newline 2016-11-01 17:54:05 +00:00
LICENSE.TXT Remove autoconf references from LICENSE.TXT 2016-08-12 20:11:03 +00:00
llvm.spec.in
LLVMBuild.txt
README.txt Revert rL277454 2016-08-02 13:26:07 +00:00
RELEASE_TESTERS.TXT Adding RELEASE_TESTERS.TXT 2016-07-21 16:46:44 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.