llvm-6502/include/llvm/Target
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
..
CostTable.h
Target.td [TableGen] Optionally forbid overlap between named and positional operands 2014-03-13 07:57:54 +00:00
TargetCallingConv.h Replace '#include ValueTypes.h' with forward declarations. 2014-03-12 08:00:24 +00:00
TargetCallingConv.td LLVM-1163: AAPCS-VFP violation when CPRC allocated to stack 2014-02-07 11:19:53 +00:00
TargetFrameLowering.h
TargetInstrInfo.h
TargetIntrinsicInfo.h
TargetItinerary.td
TargetJITInfo.h
TargetLibraryInfo.h SimplifyLibCalls: Push TLI through the exp2->ldexp transform. 2014-02-04 20:27:23 +00:00
TargetLowering.h Add a TLI hook to control when BUILD_VECTOR might be expanded using shuffles 2014-03-31 17:48:10 +00:00
TargetLoweringObjectFile.h Remove shouldEmitUsedDirectiveFor. 2014-03-06 22:47:08 +00:00
TargetMachine.h [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-05 09:10:37 +00:00
TargetOpcodes.h Replace PROLOG_LABEL with a new CFI_INSTRUCTION. 2014-03-07 06:08:31 +00:00
TargetOptions.h DebugInfo: TargetOptions/MCAsmInfo support for compressed debug info sections 2014-03-27 20:45:41 +00:00
TargetRegisterInfo.h Provide a target override for the cost of using a callee-saved register 2014-03-27 23:10:04 +00:00
TargetSchedule.td
TargetSelectionDAG.td ARM64: initial backend import 2014-03-29 10:18:08 +00:00
TargetSelectionDAGInfo.h Rename some member variables from TD to DL. 2014-02-18 15:33:12 +00:00
TargetSubtargetInfo.h