hanchenye-llvm-project/llvm
Craig Topper 74c7d6be28 [X86] Rewrite to the vXi1 subvector insertion code to not rely on the value of bits that might be undef
The previous code tried to do a trick where we would extract the subvector from the location we were inserting. Then xor that with the new value. Take the xored value and clear out the bits above the subvector size. Then shift that xored subvector to the insert location. And finally xor that with the original vector. Since the old subvector was used in both xors, this would leave just the new subvector at the inserted location. Since the surrounding bits had been zeroed no other bits of the original vector would be modified.

Unfortunately, if the old subvector came from undef we might aggressively propagate the undef. Then we end up with the XORs not cancelling because they aren't using the same value for the two uses of the old subvector. @bkramer gave me a case that demonstrated this, but we haven't reduced it enough to make it easily readable to see what's happening.

This patch uses a safer, but more costly approach. It isolate the bits above the insertion and bits below the insert point and ORs those together leaving 0 for the insertion location. Then widens the subvector with 0s in the upper bits, shifts it into position with 0s in the lower bits. Then we do another OR.

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

llvm-svn: 373495
2019-10-02 17:47:09 +00:00
..
benchmarks
bindings Revert "[OCaml] Handle nullptr in Llvm.global_initializer" 2019-10-01 08:29:07 +00:00
cmake [llvm] [cmake] Add install targets for missing distribution components 2019-10-02 16:06:50 +00:00
docs [llvm-objcopy] Add --set-section-alignment 2019-10-02 12:41:25 +00:00
examples [Orc] Roll back ThreadPool to std::function 2019-09-13 11:59:51 +00:00
include [AMDGPU] Extend buffer intrinsics with swizzling 2019-10-02 17:22:36 +00:00
lib [X86] Rewrite to the vXi1 subvector insertion code to not rely on the value of bits that might be undef 2019-10-02 17:47:09 +00:00
projects
resources
runtimes Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds. 2019-09-24 22:38:18 +00:00
test [X86] Rewrite to the vXi1 subvector insertion code to not rely on the value of bits that might be undef 2019-10-02 17:47:09 +00:00
tools [llvm] [cmake] Add install targets for missing distribution components 2019-10-02 16:06:50 +00:00
unittests [Local] Remove unused LazyValueInfo pointer from removeUnreachableBlock. 2019-10-02 16:58:13 +00:00
utils gn build: Merge r373489 2019-10-02 17:23:41 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes Fix the "git modified" issue on the preserve-comments-crlf.s. 2019-09-10 12:17:49 +00:00
.gitignore
CMakeLists.txt Reland "[utils] Implement the llvm-locstats tool" 2019-10-02 07:00:01 +00:00
CODE_OWNERS.TXT
CREDITS.TXT
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.