llvm-project/llvm
Sanjay Patel 0279b5b0b8 [TargetLowering] try harder to determine undef elements of vector binops
This might be the start of tracking all vector element constants generally if we take it to its 
logical conclusion, but let's stop here and make sure this is correct/beneficial so far.

The affected tests require a convoluted path before they get simplified currently because we 
don't call SimplifyDemandedVectorElts() from binops directly and don't modify the binop operands 
directly in SimplifyDemandedVectorElts().

That's why the tests all have a trailing shuffle to induce a chain reaction of transforms. So 
something like this is happening:

1. Improve the knowledge of undefs in the binop via a SimplifyDemandedVectorElts() call that 
   originates from a shuffle.
2. Transfer that undef knowledge back to the shuffle mask user as more undef lanes.
3. Combine the modified shuffle by calling SimplifyDemandedVectorElts() again.
4. Translate the improved shuffle mask as undemanded lanes of build vector constants causing 
   those to become full undef constants.
5. Simplify the binop now that it has a full undef operand.

As we can see from the unchanged 'and' and 'or' tests, tracking undefs alone isn't a full solution. 
We would need to track zero and all-ones constants to improve those opcodes. We'd probably need to 
track NaN for FP ops too (assuming we don't have fast-math-flags set).

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

llvm-svn: 352880
2019-02-01 15:35:12 +00:00
..
benchmarks
bindings Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
cmake [CMake] Add install targets for utilities to LLVM exports if LLVM_INSTALL_UTILS=ON 2019-02-01 13:08:09 +00:00
docs [doc]Update String Error documentation in Programmer Manual 2019-02-01 10:02:42 +00:00
examples Fix compilation of examples after 13680223b9 / r352827 2019-02-01 03:23:42 +00:00
include Provide reason messages for unviable inlining 2019-02-01 10:44:43 +00:00
lib [TargetLowering] try harder to determine undef elements of vector binops 2019-02-01 15:35:12 +00:00
projects Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
resources
runtimes Revert "[CMake] Use __libc_start_main rather than fopen when checking for C library" 2019-01-28 19:26:41 +00:00
test [TargetLowering] try harder to determine undef elements of vector binops 2019-02-01 15:35:12 +00:00
tools [llvm-strip] Implement --keep-file-symbols 2019-02-01 15:25:15 +00:00
unittests Revert r352750. 2019-02-01 10:38:40 +00:00
utils gn build: Merge r352483 2019-01-31 15:23:02 +00:00
.arcconfig
.clang-format
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
.gitattributes
.gitignore gitignore: ignore clangd index files. 2019-01-25 14:05:18 +00:00
CMakeLists.txt Revert "Bump minimum toolchain version" 2019-02-01 04:44:39 +00:00
CODE_OWNERS.TXT [llvm-mca] Move llvm-mca library to llvm/lib/MCA. 2018-12-17 08:08:31 +00:00
CREDITS.TXT Remove a period from CREDITS.TXT (testing email change). NFC 2019-01-19 09:07:38 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
README.txt
RELEASE_TESTERS.TXT Update the list of platforms & archs 2018-12-16 14:47:16 +00:00
configure
llvm.spec.in Update structured references to the license to the new license. 2019-01-19 11:30:51 +00:00

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.