1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/lib
Hal Finkel 5ecd959a9e 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.

llvm-svn: 205230
2014-03-31 17:48:10 +00:00
..
Analysis PR15967 Fix in basicaa for faulty returning no alias. 2014-03-26 21:30:19 +00:00
AsmParser Remove the linker_private and linker_private_weak linkages. 2014-03-13 23:18:37 +00:00
Bitcode All new elements except the last one initialized to NULL. Ideally, once parsing is complete, all elements should be non-NULL. 2014-03-27 12:08:23 +00:00
CodeGen Add a TLI hook to control when BUILD_VECTOR might be expanded using shuffles 2014-03-31 17:48:10 +00:00
DebugInfo DebugInfo: Support debug_loc under fission 2014-03-25 01:44:02 +00:00
ExecutionEngine [Allocator] Lift the slab size and size threshold into template 2014-03-30 12:07:07 +00:00
IR Intrinsics: add LLVMHalfElementsVectorType constraint 2014-03-29 07:04:54 +00:00
IRReader Replace OwningPtr<T> with std::unique_ptr<T>. 2014-03-06 05:51:42 +00:00
LineEditor [CMake] Use LINK_LIBS instead of target_link_libraries(). 2014-02-26 06:41:29 +00:00
Linker [Layering] Sink Linker.h into a Linker subdirectory to make it 2014-03-06 03:42:23 +00:00
LTO This patch fixes LTO's RecordStreamer so that it records symbols in the MCExpr 2014-03-31 16:59:13 +00:00
MC [MC] Remove an unused (and broken) variant of the setupForSymbolicDisassembly 2014-03-30 04:27:33 +00:00
Object [yaml2obj] Add support for ELF e_flags. 2014-03-31 09:44:05 +00:00
Option Avoid buffer copies when a Twine already is a StringRef. 2013-12-03 18:18:28 +00:00
ProfileData InstrProf: Silence spurious warnings in GCC 4.8 2014-03-24 00:47:18 +00:00
Support Support: generalise object type handling for Windows 2014-03-31 16:34:41 +00:00
TableGen tblgen: Twinify PrintFatalError. 2014-03-29 17:17:15 +00:00
Target [mips] Rewrite MipsAsmParser and MipsOperand. 2014-03-31 17:43:46 +00:00
Transforms Add a missing break. 2014-03-30 03:26:17 +00:00
CMakeLists.txt ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00
LLVMBuild.txt ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00
Makefile ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00