hanchenye-llvm-project/llvm
Simon Pilgrim 08ba012973 [X86][AVX] Lower shuffles as repeated lane shuffles then lane-crossing shuffles
This patch attempts to represent a shuffle as a repeating shuffle (recognisable by is128BitLaneRepeatedShuffleMask) with the source input(s) in their original lanes, followed by a single permutation of the 128-bit lanes to their final destinations.

On AVX2 we can additionally attempt to match using 64-bit sub-lane permutation. AVX2 can also now match a similar 'broadcasted' repeating shuffle.

This patch has several benefits:

 * Avoids prematurely matching with lowerVectorShuffleByMerging128BitLanes which can require both inputs to have their input lanes permuted before shuffling.
 * Can replace PERMPS/PERMD instructions - although these are useful for cross-lane unary shuffling, they require their shuffle mask to be pre-loaded (and increase register pressure).
 * Matching the repeating shuffle makes use of a lot of existing shuffle lowering.

There is an outstanding minor AVX1 regression (combine_unneeded_subvector1 in vector-shuffle-combining.ll) of a previously 128-bit shuffle + subvector splat being converted to a subvector splat + (2 instruction) 256-bit shuffle, I intend to fix this in a followup patch for review.

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

llvm-svn: 260834
2016-02-13 21:54:04 +00:00
..
bindings Remove LLVMGetTargetMachineData leftovers. 2016-02-12 20:26:46 +00:00
cmake cmake: Simplify the iOS.cmake toolchain 2016-02-12 23:36:05 +00:00
docs Delete the deprecated LLVMLinkModules. 2016-02-12 15:28:45 +00:00
examples Remove autoconf support 2016-01-26 21:29:08 +00:00
include [APInt] No need for a copy when taking min/max of an APInt. 2016-02-13 17:23:27 +00:00
lib [X86][AVX] Lower shuffles as repeated lane shuffles then lane-crossing shuffles 2016-02-13 21:54:04 +00:00
projects Remove autoconf support 2016-01-26 21:29:08 +00:00
resources
test [X86][AVX] Lower shuffles as repeated lane shuffles then lane-crossing shuffles 2016-02-13 21:54:04 +00:00
tools [llvm-size] Remove variable used only once. 2016-02-13 01:52:47 +00:00
unittests [Cloning] Clone every Function's Debug Info 2016-02-13 02:04:29 +00:00
utils [TableGen] Fix comment about 64-bit type I missed when I removed the underlying type in r260808. 2016-02-13 17:58:14 +00:00
.arcconfig
.clang-format
.clang-tidy adding readability-identifier-naming to llvm clang-tidy configuration. 2015-12-08 17:44:51 +00:00
.gitignore
CMakeLists.txt [CMake] Add a macro definition to detect if we are building GlobalISel: 2016-02-10 23:00:57 +00:00
CODE_OWNERS.TXT [docs] Remove references to autotools build. 2016-01-30 01:10:15 +00:00
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt Revert previous test commit. 2016-01-04 19:13:29 +00:00
configure Remove autoconf support 2016-01-26 21:29:08 +00:00
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.