LLVM backend for 6502
Go to file
Chandler Carruth acc068e873 Switch the lowering of CTLZ_ZERO_UNDEF from a .td pattern back to the
X86ISelLowering C++ code. Because this is lowered via an xor wrapped
around a bsr, we want the dagcombine which runs after isel lowering to
have a chance to clean things up. In particular, it is very common to
see code which looks like:

  (sizeof(x)*8 - 1) ^ __builtin_clz(x)

Which is trying to compute the most significant bit of 'x'. That's
actually the value computed directly by the 'bsr' instruction, but if we
match it too late, we'll get completely redundant xor instructions.

The more naive code for the above (subtracting rather than using an xor)
still isn't handled correctly due to the dagcombine getting confused.

Also, while here fix an issue spotted by inspection: we should have been
expanding the zero-undef variants to the normal variants when there is
an 'lzcnt' instruction. Do so, and test for this. We don't want to
generate unnecessary 'bsr' instructions.

These two changes fix some regressions in encoding and decoding
benchmarks. However, there is still a *lot* to be improve on in this
type of code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147244 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 10:55:54 +00:00
autoconf Attempt #2 to fix mingw crossbuild. This time with more ugly hacks! 2011-12-22 22:50:44 +00:00
bindings drop unneeded config.h includes 2011-12-22 23:04:07 +00:00
cmake Use 'check_symbol_exists' instead of 'check_function_exists' for finding isatty. This change allows Xcode generated projects to have HAVE_ISATTY to be properly defined. 2011-12-23 01:31:45 +00:00
docs
examples
include Move x86 specific bits of the COFF writer to lib/Target/X86. 2011-12-24 02:14:02 +00:00
lib Switch the lowering of CTLZ_ZERO_UNDEF from a .td pattern back to the 2011-12-24 10:55:54 +00:00
projects
runtime
test Switch the lowering of CTLZ_ZERO_UNDEF from a .td pattern back to the 2011-12-24 10:55:54 +00:00
tools drop unneeded config.h includes 2011-12-22 23:04:07 +00:00
unittests
utils
.gitignore
CMakeLists.txt
configure Attempt #2 to fix mingw crossbuild. This time with more ugly hacks! 2011-12-22 22:50:44 +00:00
CREDITS.TXT CREDITS.TXT: Add a line. (test commit) 2011-10-29 23:42:14 +00:00
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
Makefile
Makefile.common
Makefile.config.in
Makefile.rules
README.txt

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

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, 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 HTML documentation provided in docs/index.html for further
assistance with LLVM.

If you're writing a package for LLVM, see docs/Packaging.html for our
suggestions.