LLVM backend for 6502
Go to file
Hal Finkel adbf9764ae Add a TLI hook to control when BUILD_VECTOR might be expanded using shuffles
There are two general methods for expanding a BUILD_VECTOR node:
  1. Use SCALAR_TO_VECTOR on the defined scalar values and then shuffle
     them together.
  2. Build the vector on the stack and then load it.

Currently, we use a fixed heuristic: If there are only one or two unique
defined values, then we attempt an expansion in terms of SCALAR_TO_VECTOR and
vector shuffles (provided that the required shuffle mask is legal). Otherwise,
always expand via the stack. Even when SCALAR_TO_VECTOR is not legal, this
can still be a good idea depending on what tricks the target can play when
lowering the resulting shuffle. If the target can't do anything special,
however, and if SCALAR_TO_VECTOR is expanded via the stack, this heuristic
leads to sub-optimal code (two stack loads instead of one).

Because only the target knows whether the SCALAR_TO_VECTORs and shuffles for a
build vector of a particular type are likely to be optimial, this adds a new
TLI function: shouldExpandBuildVectorWithShuffles which takes the vector type
and the count of unique defined values. If this function returns true, then
method (1) will be used, subject to the constraint that all of the necessary
shuffles are legal (as determined by isShuffleMaskLegal). If this function
returns false, then method (2) is always used.

This commit does not enhance the current code to support expanding a
build_vector with more than two unique values using shuffles, but I'll commit
an implementation of the more-general case shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205230 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 17:48:10 +00:00
autoconf ARM64: initial backend import 2014-03-29 10:18:08 +00:00
bindings [python-bindings] Remove some cruft that snuck in. 2014-02-23 04:43:26 +00:00
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 Fix warnings about an variable only used in asserts. 2014-03-06 06:35:46 +00:00
include Add a TLI hook to control when BUILD_VECTOR might be expanded using shuffles 2014-03-31 17:48:10 +00:00
lib Add a TLI hook to control when BUILD_VECTOR might be expanded using shuffles 2014-03-31 17:48:10 +00:00
projects Remove projects/sample. 2014-03-12 22:40:22 +00:00
test [mips] Rewrite MipsAsmParser and MipsOperand. 2014-03-31 17:43:46 +00:00
tools [yaml2obj] Add support for ELF e_flags. 2014-03-31 09:44:05 +00:00
unittests Support: generalise object type handling for Windows 2014-03-31 16:34:41 +00:00
utils tblgen: Twinify PrintFatalError. 2014-03-29 17:17:15 +00:00
.arcconfig
.clang-format Test commit. 2014-03-02 13:08:46 +00:00
.gitignore Remove projects/sample. 2014-03-12 22:40:22 +00:00
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 Fix documentation typos 2013-12-20 00:33:39 +00:00
LICENSE.TXT Remove projects/sample. 2014-03-12 22:40:22 +00:00
llvm.spec.in
LLVMBuild.txt Remove the very substantial, largely unmaintained legacy PGO 2013-10-02 15:42:23 +00:00
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 Add a --enable-clang-plugin-support option to configure. 2014-03-10 16:58:35 +00:00
Makefile.rules Use -std=gnu++11 on cygwin and mingw. 2014-03-12 20:01:15 +00:00
README.txt Revert "Test commit to check e-mail address. Please discard this." 2013-10-04 10:59:13 +00:00

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.