LLVM backend for 6502
Go to file
Hal Finkel 65fafbb109 Look at shuffles of build_vectors in DAGCombiner::visitEXTRACT_VECTOR_ELT
When the loop vectorizer vectorizes code that uses the loop induction variable,
we often end up with IR like this:

  %b1 = insertelement <2 x i32> undef, i32 %v, i32 0
  %b2 = shufflevector <2 x i32> %b1, <2 x i32> undef, <2 x i32> zeroinitializer
  %i = add <2 x i32> %b2, <i32 2, i32 3>

If the add in this example is not legal (as is the case on PPC with VSX), it
will be scalarized, and we'll end up with a number of extract_vector_elt nodes
with the vector shuffle as the input operand, and that vector shuffle is fed by
one or more build_vector nodes. By the time that vector operations are
expanded, visitEXTRACT_VECTOR_ELT will not create new extract_vector_elt by
looking through the vector shuffle (to make sure that no illegal operations are
created), and so the extract_vector_elt -> vector shuffle -> build_vector is
never simplified to an operand of the build vector.

By looking at build_vectors through a shuffle we fix this particular situation,
preventing a vector from being built, only to be deconstructed again (for the
scalarized add) -- an expensive proposition when this all needs to be done via
the stack. We probably want a more comprehensive fix here where we look back
recursively through any shuffles to any build_vectors or scalar_to_vectors,
etc. but that can come later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205179 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 11:43:19 +00:00
autoconf ARM64: initial backend import 2014-03-29 10:18:08 +00:00
bindings
cmake ARM64: initial backend import 2014-03-29 10:18:08 +00:00
docs Exception handling docs: Clarify how the llvm.eh.* intrinsics are used 2014-03-28 17:08:57 +00:00
examples
include [yaml2obj] Add support for ELF e_flags. 2014-03-31 09:44:05 +00:00
lib Look at shuffles of build_vectors in DAGCombiner::visitEXTRACT_VECTOR_ELT 2014-03-31 11:43:19 +00:00
projects
test Look at shuffles of build_vectors in DAGCombiner::visitEXTRACT_VECTOR_ELT 2014-03-31 11:43:19 +00:00
tools [yaml2obj] Add support for ELF e_flags. 2014-03-31 09:44:05 +00:00
unittests [Allocator] Lift the slab size and size threshold into template 2014-03-30 12:07:07 +00:00
utils tblgen: Twinify PrintFatalError. 2014-03-29 17:17:15 +00:00
.arcconfig
.clang-format
.gitignore
CMakeLists.txt ARM64: initial backend import 2014-03-29 10:18:08 +00:00
CODE_OWNERS.TXT Update my e-mail address in CODE_OWNERS.TXT 2014-03-13 18:04:41 +00:00
configure ARM64: initial backend import 2014-03-29 10:18:08 +00:00
CREDITS.TXT
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
Makefile [configure/make] Propagate names of build host tools when making BuildTools 2014-03-25 21:45:41 +00:00
Makefile.common
Makefile.config.in
Makefile.rules
README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, 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're writing a package for LLVM, see docs/Packaging.rst for our
suggestions.