llvm-project/llvm
Sanjay Patel a0d8a278a7 [x86] use a single shufps when it can save instructions
This is a tiny patch with a big pile of test changes.
This partially fixes PR27885:
https://llvm.org/bugs/show_bug.cgi?id=27885

My motivating case looks like this:

  - vpshufd {{.*#+}} xmm1 = xmm1[0,1,0,2]
  - vpshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
  - vpblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm1[4,5,6,7]

  + vshufps {{.*#+}} xmm0 = xmm0[0,2],xmm1[0,2]

And this happens several times in the diffs. For chips with domain-crossing penalties,
the instruction count and size reduction should usually overcome any potential 
domain-crossing penalty due to using an FP op in a sequence of int ops. For chips such
as recent Intel big cores and Atom, there is no domain-crossing penalty for shufps, so
using shufps is a pure win.

So the test case diffs all appear to be improvements except one test in 
vector-shuffle-combining.ll where we miss an opportunity to use a shift to generate 
zero elements and one test in combine-sra.ll where multiple uses prevent the expected
shuffle combining.

Differential Revision: https://reviews.llvm.org/D27692

llvm-svn: 289837
2016-12-15 18:03:38 +00:00
..
bindings Fix go bindings after r289702 (hopefully, don't really know how to build 2016-12-15 06:54:29 +00:00
cmake [CMake] Multi-target builtins build 2016-12-12 23:15:10 +00:00
docs Simplify format member detection in FormatVariadic 2016-12-15 09:40:27 +00:00
examples Prune unused libdeps. 2016-12-08 15:28:02 +00:00
include Extract LaneBitmask into a separate type 2016-12-15 14:36:06 +00:00
lib [x86] use a single shufps when it can save instructions 2016-12-15 18:03:38 +00:00
projects
resources
runtimes [CMake] Multi-target builtins build 2016-12-12 23:15:10 +00:00
test [x86] use a single shufps when it can save instructions 2016-12-15 18:03:38 +00:00
tools [ARM] Implement execute-only support in CodeGen 2016-12-15 07:59:08 +00:00
unittests Simplify format member detection in FormatVariadic 2016-12-15 09:40:27 +00:00
utils Fix ubsan failures in lane mask shifts 2016-12-15 16:08:49 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore [AVR] Add the integrated testing tool to the .gitignore 2016-12-14 11:47:14 +00:00
CMakeLists.txt [CMake] Fixing clang standalone build 2016-12-06 17:09:29 +00:00
CODE_OWNERS.TXT CODE_OWNERS: Take ownership of IR Linker as discussed on llvm-dev 2016-12-02 14:06:53 +00:00
CREDITS.TXT Revert revision 289721. 2016-12-14 21:58:42 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt Test commit, deleted empty line at the end of README.txt 2016-11-07 18:31:21 +00:00
RELEASE_TESTERS.TXT
configure
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.