llvm-project/llvm/lib
Andrea Di Biagio ce46b97b48 [X86] Teach method 'isVectorClearMaskLegal' how to check for legal blend masks.
This patch improves the folding of vector AND nodes into blend operations for
targets that feature SSE4.1. A vector AND node where one of the operands is
a constant build_vector with elements that are either zero or all-ones can be
converted into a blend.

This allows for example to simplify the following code:

define <4 x i32> @test(<4 x i32> %A, <4 x i32> %B) {
  %1 = and <4 x i32> %A, <i32 0, i32 0, i32 0, i32 -1>
  %2 = and <4 x i32> %B, <i32 -1, i32 -1, i32 -1, i32 0>
  %3 = or <4 x i32> %1, %2
  ret <4 x i32> %3
}

Before this patch llc (-mcpu=corei7) generated:
        andps  LCPI1_0(%rip), %xmm0, %xmm0
        andps  LCPI1_1(%rip), %xmm1, %xmm1
        orps   %xmm1, %xmm0, %xmm0
        retq

With this patch we generate a single 'vpblendw'.

llvm-svn: 221343
2014-11-05 13:04:14 +00:00
..
Analysis InstSimplify: Exact shifts of X by Y are X if X has the lsb set 2014-11-05 00:59:59 +00:00
AsmParser X86: Implement the vectorcall calling convention 2014-10-28 01:29:26 +00:00
Bitcode IR: MDNode => Value: Instruction::getAllMetadataOtherThanDebugLoc() 2014-11-03 18:13:57 +00:00
CodeGen [X86] Teach method 'isVectorClearMaskLegal' how to check for legal blend masks. 2014-11-05 13:04:14 +00:00
DebugInfo [dwarfdump] Dump DW_AT_ranges values inline in the debug_info dump. 2014-10-23 04:08:34 +00:00
ExecutionEngine [JIT] Fix some more missing endian conversions in RuntimeDyld 2014-11-01 15:52:31 +00:00
IR IR: Metadata: Remove unnecessary dyn_cast 2014-11-05 01:55:06 +00:00
IRReader Pass a && to getLazyBitcodeModule. 2014-09-03 17:31:46 +00:00
LTO Add an option to the LTO code generator to disable vectorization during LTO 2014-10-26 21:50:58 +00:00
LineEditor [CMake] Use LINK_LIBS instead of target_link_libraries(). 2014-02-26 06:41:29 +00:00
Linker Revert r221096 bringing back r221014 with a fix. 2014-11-02 13:28:57 +00:00
MC Don't produce relocations for a difference in a section with no symbols. 2014-11-04 22:10:33 +00:00
Object llvm-readobj: Add support for dumping the DOS header in PE files 2014-11-05 06:24:35 +00:00
Option Add an overload of getLastArgNoClaim taking two OptSpecifiers. 2014-09-12 19:42:53 +00:00
ProfileData Use ErrorOr for the ::create factory on instrumented and sample profilers. 2014-11-03 00:51:45 +00:00
Support llvm-readobj: Add support for dumping the DOS header in PE files 2014-11-05 06:24:35 +00:00
TableGen Eliminate some deep std::vector copies. NFC. 2014-10-03 18:33:16 +00:00
Target [X86] Teach method 'isVectorClearMaskLegal' how to check for legal blend masks. 2014-11-05 13:04:14 +00:00
Transforms Revert "[Reassociate] Canonicalize negative constants out of expressions." 2014-11-04 23:42:45 +00:00
CMakeLists.txt ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00
LLVMBuild.txt ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00
Makefile ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00