llvm-project/llvm
David Sherwood 2a48b6993a [IR] In ConstantFoldShuffleVectorInstruction use zeroinitializer for splats of 0
When creating a splat of 0 for scalable vectors we tend to create them
with using a combination of shufflevector and insertelement, i.e.

shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 0, i32 0),
               <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)

However, for the case of a zero splat we can actually just replace the
above with zeroinitializer instead. This makes the IR a lot simpler and
easier to read. I have changed ConstantFoldShuffleVectorInstruction to
use zeroinitializer when creating a splat of integer 0 or FP +0.0 values.

Differential Revision: https://reviews.llvm.org/D113394
2021-11-10 09:42:58 +00:00
..
benchmarks
bindings
cmake [TableGen] Emit a warning for unused template args 2021-11-03 11:55:07 +00:00
docs Revert "[DebugInfo] Enforce implicit constraints on `distinct` MDNodes" 2021-11-09 14:27:55 -08:00
examples Revert "Use `GNUInstallDirs` to support custom installation dirs. -- LLVM" 2021-11-02 19:11:44 +01:00
include Reland [XCOFF][yaml2obj] support for the auxiliary file header. 2021-11-10 07:23:56 +00:00
lib [IR] In ConstantFoldShuffleVectorInstruction use zeroinitializer for splats of 0 2021-11-10 09:42:58 +00:00
projects Remove unused parallel-libs project 2021-10-21 14:34:39 -07:00
resources
runtimes
test [IR] In ConstantFoldShuffleVectorInstruction use zeroinitializer for splats of 0 2021-11-10 09:42:58 +00:00
tools [llvm-objdump] Remove a trailing semicolon, fixing GCC warnings. NFC. 2021-11-10 09:39:47 +02:00
unittests [Demangle] Add minimal support for D programming language 2021-11-09 09:29:13 -08:00
utils [gn build] Port a35efc4dcb 2021-11-10 09:27:55 +00:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [NFC] Inclusive language: Remove instances of master in URLs 2021-11-05 08:48:41 -05:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.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.