llvm-project/llvm
Craig Topper b51dc64063 [X86] Add DAG combine to fold any_extend_vector_inreg+truncstore to an extractelement+store
We have custom code that ignores the normal promoting type legalization on less than 128-bit vector types like v4i8 to emit pavgb, paddusb, psubusb since we don't have the equivalent instruction on a larger element type like v4i32. If this operation appears before a store, we can be left with an any_extend_vector_inreg followed by a truncstore after type legalization. When truncstore isn't legal, this will normally be decomposed into shuffles and a non-truncating store. This will then combine away the any_extend_vector_inreg and shuffle leaving just the store. On avx512, truncstore is legal so we don't decompose it and we had no combines to fix it.

This patch adds a new DAG combine to detect this case and emit either an extract_store for 64-bit stoers or a extractelement+store for 32 and 16 bit stores. This makes the avx512 codegen match the avx2 codegen for these situations. I'm restricting to only when -x86-experimental-vector-widening-legalization is false. When we're widening we're not likely to create this any_extend_inreg+truncstore combination. This means we should be able to remove this code when we flip the default. I would like to flip the default soon, but I need to investigate some performance regressions its causing in our branch that I wasn't seeing on trunk.

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

llvm-svn: 367488
2019-07-31 22:43:08 +00:00
..
benchmarks
bindings
cmake Re-disable C4324 MSVC warning that was enabled in D65458 / rL367383 2019-07-31 11:06:05 +00:00
docs Attempt to unbreak sphinx build bot by inserting a link. 2019-07-31 22:14:26 +00:00
examples [ORC] Add deprecation warnings to ORCv1 layers and utilities. 2019-07-17 16:40:52 +00:00
include [NFC] allow creating error strings from a Twine 2019-07-31 21:09:53 +00:00
lib [X86] Add DAG combine to fold any_extend_vector_inreg+truncstore to an extractelement+store 2019-07-31 22:43:08 +00:00
projects Revert "[libc++] Integrate the PSTL into libc++" 2019-07-19 18:52:46 +00:00
resources
runtimes
test [X86] Add DAG combine to fold any_extend_vector_inreg+truncstore to an extractelement+store 2019-07-31 22:43:08 +00:00
tools Reland "[DwarfDebug] Dump call site debug info" 2019-07-31 16:51:28 +00:00
unittests [Support] Added overflow checking add, sub and mul. 2019-07-31 19:40:07 +00:00
utils gn build: Merge r367463 2019-07-31 18:56:49 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [build] Add the ability to create a symlink for lipo 2019-07-31 16:46:57 +00:00
CODE_OWNERS.TXT Update email address in CODE_OWNERS 2019-07-01 16:01:15 +00:00
CREDITS.TXT Update email address. 2019-07-17 07:02:02 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

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.