llvm-6502/lib
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
..
Analysis Make the unreachable probability much much heavier. The previous 2011-12-22 09:26:37 +00:00
Archive Support/FileSystem: Add file_magic and move a vew clients over to it. 2011-12-13 23:17:12 +00:00
AsmParser Removes unused field TheError from LLLexer. 2011-12-21 10:02:45 +00:00
Bitcode The powers that be have decided that LLVM IR should now support 16-bit 2011-12-17 00:04:22 +00:00
CodeGen drop unneeded config.h includes 2011-12-22 23:04:07 +00:00
DebugInfo Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
ExecutionEngine Fix up the CMake build for the new files added in r146960, they're 2011-12-20 08:42:11 +00:00
Linker When not destroying the source, the linker is not remapping the types. Added support 2011-12-23 02:18:32 +00:00
MC Move x86 specific bits of the COFF writer to lib/Target/X86. 2011-12-24 02:14:02 +00:00
Object Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
Support drop unneeded config.h includes 2011-12-22 23:04:07 +00:00
TableGen TableGen: add a comment 2011-12-22 23:16:09 +00:00
Target Switch the lowering of CTLZ_ZERO_UNDEF from a .td pattern back to the 2011-12-24 10:55:54 +00:00
Transforms Fix typo "infinte". 2011-12-23 23:49:25 +00:00
VMCore Give string constants generated by IRBuilder private linkage. 2011-12-22 14:22:14 +00:00
CMakeLists.txt Move TableGen's parser and entry point into a library 2011-10-01 16:41:13 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile Remove more of llvmc and dependencies. 2011-09-20 00:34:27 +00:00