Go to file
Davide Italiano a195386ca1 [SimplifyLibCalls] Correctly set the is_zero_undef flag for llvm.cttz
If <src> is non-zero we can safely set the flag to true, and this
results in less code generated for, e.g. ffs(x) + 1 on FreeBSD.
Thanks to majnemer for suggesting the fix and reviewing.

Code generated before the patch was applied:


 0:   0f bc c7                bsf    %edi,%eax
 3:   b9 20 00 00 00          mov    $0x20,%ecx
 8:   0f 45 c8                cmovne %eax,%ecx
 b:   83 c1 02                add    $0x2,%ecx
 e:   b8 01 00 00 00          mov    $0x1,%eax
13:   85 ff                   test   %edi,%edi
15:   0f 45 c1                cmovne %ecx,%eax
18:   c3                      retq

Code generated after the patch was applied:

 0:   0f bc cf                bsf    %edi,%ecx
 3:   83 c1 02                add    $0x2,%ecx
 6:   85 ff                   test   %edi,%edi
 8:   b8 01 00 00 00          mov    $0x1,%eax
 d:   0f 45 c1                cmovne %ecx,%eax
10:   c3                      retq

It seems we can still use cmove and save another 'test' instruction, but
that can be tackled separately.

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

llvm-svn: 244947
2015-08-13 20:34:26 +00:00
clang Fix previous commit: poison only class members, simpler tests 2015-08-13 18:35:11 +00:00
clang-tools-extra Fix formatting. 2015-08-13 09:09:28 +00:00
compiler-rt [UBSan] Enable 'help' option output, report unrecognized flags 2015-08-13 20:34:00 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Require LLVM >=3.7 and bump version to 0.2.0 2015-08-07 08:31:37 +00:00
libcxx Fix CMake error whet llvm-config reports a non-existent source directory. 2015-08-12 06:36:19 +00:00
libcxxabi Update to new lists.llvm.org 2015-08-05 04:01:26 +00:00
libunwind Enable zero-cost exceptions on non-Apple arm64 platforms 2015-08-13 14:21:03 +00:00
lld Correctly align output sections. 2015-08-13 20:24:18 +00:00
lldb Remove more uses of raw_svector_ostream::flush() call following r244928. 2015-08-13 18:48:44 +00:00
llgo Update to new lists.llvm.org 2015-08-05 04:03:05 +00:00
llvm [SimplifyLibCalls] Correctly set the is_zero_undef flag for llvm.cttz 2015-08-13 20:34:26 +00:00
openmp Remove unused KMP_SETVERSION macro 2015-08-13 15:26:38 +00:00
polly Manuallt simplify test case 2015-08-13 16:33:32 +00:00