llvm-6502/lib
Andrea Di Biagio e46783d5b7 [CodeGenPrepare] Improved logic to speculate calls to cttz/ctlz.
This patch improves the logic added at revision 224899 (see review D6728) that
teaches the backend when it is profitable to speculate calls to cttz/ctlz.

The original algorithm conservatively avoided speculating more than one
instruction from a basic block in a control flow grap modelling an if-statement.
In particular, the only allowed instruction (excluding the terminator) was a
call to cttz/ctlz. However, there are cases where we could be less conservative
and still be able to speculate a call to cttz/ctlz.

With this patch, CodeGenPrepare now tries to speculate a cttz/ctlz if the
result is zero extended/truncated in the same basic block, and the zext/trunc
instruction is "free" for the target.

Added new test cases to CodeGen/X86/cttz-ctlz.ll

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225274 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 17:41:18 +00:00
..
Analysis [PM] Add a utility pass template that synthesizes the invalidation of 2015-01-06 04:49:44 +00:00
AsmParser
Bitcode [PM] Switch the new pass manager to use a reference-based API for IR 2015-01-05 02:47:05 +00:00
CodeGen [CodeGenPrepare] Improved logic to speculate calls to cttz/ctlz. 2015-01-06 17:41:18 +00:00
DebugInfo Implement a very basic colored syntax highlighting for llvm-dwarfdump. 2015-01-06 16:50:25 +00:00
ExecutionEngine RTDyldMemoryManager.cpp: Make the reference to __morestack weak. 2014-12-30 22:52:33 +00:00
IR [PM] Add a utility pass template that synthesizes the invalidation of 2015-01-06 04:49:44 +00:00
IRReader
LineEditor
Linker
LTO
MC Revert r225048: It broke ObjC on AArch64. 2015-01-06 00:54:32 +00:00
Object Don't loop endlessly for MachO files with 0 ncmds 2015-01-06 17:08:26 +00:00
Option
ProfileData
Support [APFloat][ADT] Fix sign handling logic for FMA results that truncate to zero. 2015-01-04 01:20:55 +00:00
TableGen
Target [Hexagon] Fix 225267. GP register is not yet fully implemented. Removing Uses [GP] maintains existing behavior. 2015-01-06 16:52:38 +00:00
Transforms Reapply: Teach SROA how to update debug info for fragmented variables. 2015-01-06 17:14:10 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile