1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-27 05:53:07 +01:00
llvm-mirror/lib
Davide Italiano 3672dcbb24 [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
..
Analysis [PM/AA] Remove the AliasDebugger pass. 2015-08-12 22:54:47 +00:00
AsmParser Fix with a bit more care. (but only a bit) 2015-08-03 20:55:00 +00:00
Bitcode Rangify for loop, NFC. 2015-08-10 07:04:29 +00:00
CodeGen MIR Parser: Extract the code that parses the alignment into a new method. NFC. 2015-08-13 20:33:33 +00:00
DebugInfo Fix some comment typos. 2015-08-08 18:27:36 +00:00
ExecutionEngine Remove and forbid raw_svector_ostream::flush() calls. 2015-08-13 18:12:56 +00:00
Fuzzer Fix missing space in libfuzzer's help text. 2015-08-12 20:00:10 +00:00
IR Remove raw_svector_ostream::resync and users. It's no-op after r244870. 2015-08-13 12:42:25 +00:00
IRReader Return a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC. 2015-06-16 22:27:55 +00:00
LibDriver There is only one saver of strings. 2015-08-13 01:07:02 +00:00
LineEditor
Linker Linker: Move distinct MDNodes instead of cloning 2015-08-03 17:09:38 +00:00
LTO Remove access to the DataLayout in the TargetMachine 2015-07-24 16:04:22 +00:00
MC Remove and forbid raw_svector_ostream::flush() calls. 2015-08-13 18:12:56 +00:00
Object Convert getSymbolSection to return an ErrorOr. 2015-08-07 23:27:14 +00:00
Option Add an ArgList::AddAllArgs that accepts a vector of OptSpecifier. 2015-07-29 17:34:41 +00:00
Passes
ProfileData Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Support Fix GCC warning: extra `;' [-Wpedantic]. 2015-08-13 18:10:19 +00:00
TableGen TableGen: Support folding casts from bits to int 2015-07-31 01:12:06 +00:00
Target Remove and forbid raw_svector_ostream::flush() calls. 2015-08-13 18:12:56 +00:00
Transforms [SimplifyLibCalls] Correctly set the is_zero_undef flag for llvm.cttz 2015-08-13 20:34:26 +00:00
CMakeLists.txt LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00
LLVMBuild.txt Wrap some long lines in LLVMBuild files. NFC 2015-06-12 18:44:57 +00:00
Makefile LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00