This pass provides access to the codegen interfaces that are needed for IR‐level transformations.
Synopsis
Declared in <llvm/Analysis/TargetTransformInfo.h>
class TargetTransformInfo;
Types
Name |
Description |
Cost metrics used by Loop Strength Reduction. |
|
Returns options for expansion of memcmp. IsZeroCmp is |
|
Describe the values an operand can take. |
|
Parameters that control the loop peeling transformation. |
|
Describe known properties for a set of pointers. |
|
Parameters that control the generic loop unrolling transformation. |
|
Describe how a vector‐predicated operation should be legalized. |
Type Aliases
Name |
Description |
Alias of |
Enums
Name |
Description |
Which addressing mode Loop Strength Reduction will try to generate. |
|
The possible cache levels. |
|
Represents a hint about the context in which a cast is used. |
|
Some targets only support masked load/store with a constant mask. |
|
The type of load/store indexing. |
|
Additional information about an operand's possible values. |
|
Additional properties of an operand's values. |
|
Kind of extend used in a partial reduction. |
|
Flags indicating the kind of support for population count. |
|
Shuffle pattern used when expanding a reduction intrinsic. |
|
Kind of register whose bit width is being queried. |
|
The various kinds of shuffle patterns for vector queries. |
|
Underlying constants for 'cost' values in this interface. |
|
The kind of cost model. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy TargetTransformInfo. |
Move‐assign TargetTransformInfo. |
|
Return true if LSR should query isLegalAddressingMode with an Instruction. |
|
Return false if a |
|
Return a value to be added to the inlining threshold. |
|
Returns true if GEP should not be used to index into vectors for this target. |
|
Determine if the target supports unaligned memory accesses. |
|
Return true if the two functions have compatible attributes for inlining. |
|
Return true if caller and callee agree on how |
|
Return true if globals in this address space can have initializers other than |
|
Return true if the target can fuse a compare and branch. |
|
Return true if the target can save a compare for loop count, for example hardware loop saves a compare. |
|
Return any intrinsic address operand indexes which may be rewritten if they use a flat address space pointer. |
|
Collect kernel launch bounds for |
|
|
|
Don't restrict interleaved unrolling to small loops. |
|
Enable matching of interleaved access groups. |
|
Enable matching of interleaved access groups that contain predicated accesses or gaps and therefore vectorized using masked vector loads/stores. |
|
Return target options for expanding memcmp. |
|
Return true if we should be enabling ordered reductions for the target. |
|
Return true when scalable vectorization is preferred. |
|
Should the Select Optimization pass be enabled and ran. |
|
Return true if prefetching should also be done for writes. |
|
Return true if the target forces scalarizing of llvm.masked.gather intrinsics. |
|
Return true if the target forces scalarizing of llvm.masked.scatter intrinsics. |
|
Return a mask of pointer bits preserved by an address‐space cast. |
|
Return the cost of computing an address for a memory operation. |
|
Return the cost of an alternating‐opcode pattern lowered as one instruction. |
|
Estimate the reciprocal‐throughput cost of a math or logic instruction. |
|
Calculate the cost of vector reduction intrinsics. |
|
Return an assumed address space for value |
|
Return the max element size in bytes for unordered‐atomic mem intrinsics. |
|
Return estimated branch‐misprediction penalty in latency. |
|
Return the expected cost of control‐flow instructions such as Phi or Br. |
|
Return the associativity of the cache level, if available. |
|
Return the size of a cache line in bytes. |
|
Return the size of the cache level in bytes, if available. |
|
Return the cost of Call instructions. |
|
Return the cost of leaving an Alloca in the caller when not inlined. |
|
Return the expected cost of cast instructions such as bitcast or trunc. |
|
Return the expected cost of compare and select instructions. |
|
Return the cost of keeping values of the given types alive over a call. |
|
Query the target for which minimum VF epilogue vectorization should use. |
|
Return the estimated number of case clusters when lowering |
|
Return the cost of an extended reduction pattern. |
|
Return the expected cost of a sign‐ or zero‐extended vector extract. |
|
Return the expected cost of supporting the floating point operation of the specified type. |
|
Returns a bitmask constructed from the target‐features or fmv‐features metadata of a function corresponding to its Arch Extensions. |
|
Return the address space ID for a target's flat address space. |
|
Estimate the cost of a GEP operation when lowered. |
|
Return the size cost of rematerializing a GlobalValue versus a reload. |
|
Return the cost of inserting or extracting a lane from the vector end. |
|
Return a penalty for invoking call |
|
Return the vector‐instruction inlining bonus as a percent. |
|
Return the profitability multiplier used by inlining cost‐benefit analysis. |
|
Return the savings multiplier used by inlining cost‐benefit analysis. |
|
Return the bonus of inlining the last call to a static function. |
|
TODO: This is a rather blunt instrument. Perhaps altering the costs of individual classes of instructions would be better. |
|
Return the expected cost of aggregate inserts and extracts. |
|
|
|
Return the size‐optimization cost of materializing the given integer. |
|
Return the expected cost of materializing the given integer immediate. |
|
Return the materialization cost of an immediate used by an instruction. |
|
Return the materialization cost of an immediate used by an intrinsic. |
|
Return the cost of an interleaved memory operation. |
|
Return the cost of Intrinsic instructions. Analyses the real arguments. |
|
Return the largest vector bitwidth for loads and stores in |
|
Return the adjusted VF if the target cannot use |
|
Return the maximum interleave factor any transform should try for this target. |
|
Returns the maximum memset / memcpy size in bytes that still makes it profitable to inline the call. |
|
Return the maximum number of function arguments the target supports. |
|
Return the maximum number of iterations to prefetch ahead. |
|
Return the architectural maximum vscale, if the target specifies one. |
|
Return the maximum VF for the given element width and opcode, or 0. |
|
Return the cost of memory intrinsic instructions. |
|
Return the expected cost of a memcpy. |
|
Return the type to use in a loop expansion of a memcpy call. |
|
Calculate operand types to copy |
|
Return the cost of Load and Store instructions. |
|
Return the cost of a min/max vector reduction. |
|
Return the minimum architectural page size for the target. |
|
Return the minimum stride in bytes at which software prefetching is useful. |
|
Return the minimum trip count to consider vectorizing with tail‐folding. |
|
Return the width of the smallest vector register type. |
|
Return the minimum bit width to use for integer switch lookup table elements on this target. |
|
Return the minimum VF for the given element width, or 0 if there is none. |
|
Return the cost of a multiply‐accumulate reduction pattern. |
|
Return how many padding bytes to add for a global array of the given size. |
|
Return how many parts |
|
Return the number of registers in the target‐provided register class. |
|
Estimate the overhead of scalarizing operands with the given types. |
|
Return a value holding the result of the given memory intrinsic. |
|
Return the cost of a partial reduction from a vector to a narrower vector. |
|
Get target‐customized preferences for generic loop peeling. |
|
Estimate the cost of a chain of pointer operations when lowered. |
|
Return hardware support for population count. |
|
Return a predicated pointer and its address space for value |
|
If a branch or a select condition is skewed in one direction by more than this factor, it is very likely to be predicted correctly. |
|
Return the preferred addressing mode LSR should make efforts to generate. |
|
Return the shuffle pattern used to expand the given reduction intrinsic. |
|
Query the target what the preferred style of tail folding is. |
|
Return how many instructions before a load a prefetch should be placed. |
|
Returns a bitmask constructed from the target‐features or fmv‐features metadata of a function corresponding to its FMV priority. |
|
Returns the estimated number of registers required to represent |
|
Return the width of the largest scalar or vector register type. |
|
Return the target‐provided register class ID for the provided type. |
|
Return the target‐provided register class name. |
|
Return the cost of reloading a register in the given class from the stack. |
|
Return the cost of spilling a register in the given class to the stack. |
|
Return the cost of a replication shuffle of |
|
Estimate the overhead of scalarizing an instruction. |
|
Return the cost of the scaling factor used in addressing mode AM. |
|
Return the cost of a shuffle of kind |
|
Return the minimum vectorization factor for a store instruction. |
|
Return the adjusted VF if the target cannot use |
|
Return true if the intrinsic is a supported memory intrinsic. |
|
Get target‐customized preferences for the generic loop unrolling transformation. The caller will initialize UP with the current target‐independent defaults. |
|
Return how the target needs this vector‐predicated operation transformed. |
|
Return the vscale value used to tune the cost model. |
|
Get target‐specific uniformity information for a value. |
|
Return the expected cost of vector Insert and Extract. |
|
@{ Return true if the target supports the %evl parameter of VP intrinsics. |
|
Return whether a 32‐bit branch instruction is available in Arm or Thumb. |
|
Return true if branch divergence exists. |
|
Return true if the target supports fault‐suppressing predicated load/store. |
|
Return true if the target has a unified division‐and‐remainder operation. |
|
Return true if the memory access |
|
Return true if the hardware has a fast carry‐less multiplication instruction. |
|
Return true if the hardware has a fast square‐root instruction. |
|
Combine a target‐specific intrinsic during InstCombine. |
|
Handle the invalidation of this information. |
|
Return true if the given type is supported for scalable vectors. |
|
Return true if |
|
Return true if an FP NaN check is cheaper than comparing against 0.0. |
|
Return true if auto‐vectorizing FP ops may change scalar FP semantics. |
|
Query the target whether it would be profitable to convert the given loop into a hardware loop. |
|
Return true if the specified indexed load for the given type is legal. |
|
Return true if the specified indexed store for the given type is legal. |
|
Return true if LSR cost of C1 is lower than C2. |
|
Return true if |
|
Return true if adding |
|
Return true if the given addressing mode is legal for a load/store of |
|
Return true if an alternating‐opcode pattern can be a single instruction. |
|
Return true if the target supports broadcasting a load to a vector. |
|
Return true if |
|
Return true is the target supports interleaved access for the given vector type |
|
Return true if the target supports masked compress store. |
|
Return true if the target supports masked expand load. |
|
Return true if the target supports masked gather. |
|
Return true if the target supports masked load. |
|
Return true if the target supports masked scatter. |
|
Return true if the target supports masked store. |
|
Return true if the target supports masked vector histograms. |
|
Return true if the target supports nontemporal load. |
|
Return true if the target supports nontemporal store. |
|
Return true if the target supports strided load. |
|
Return true if the load instruction is legal to vectorize. |
|
Return true if it is legal to vectorize the given load chain. |
|
Return true if it is legal to vectorize the given reduction kind. |
|
Return true if the store instruction is legal to vectorize. |
|
Return true if it is legal to vectorize the given store chain. |
|
Test whether calls to a function lower to actual program function calls. |
|
Returns true if this is an instance of a function with multiple versions. |
|
Return true if casting from |
|
Return true if LSR should treat the number of registers as the major cost. |
|
Return true if LSR should not optimize a chain that includes |
|
Return true if it is profitable to hoist instruction in the then/else to before if. |
|
Return true if sinking operands of |
|
Return true if the target is known to be single‐threaded. |
|
Identify if the vector form of the intrinsic is overloaded at |
|
Identify if the vector form of the intrinsic has a scalar operand. |
|
Identify if a struct‐returning vector intrinsic is overloaded at |
|
Return true if it's free to truncate a value of type Ty1 to type Ty2. |
|
Return true if this type is legal. |
|
Determine if an instruction with Custom uniformity can be proven uniform based on which operands are uniform. |
|
Query the target whether the specified address space cast from FromAS to ToAS is valid. |
|
Return true if a uniform scalar shift is much cheaper than a per‐lane one. |
|
Return true if SLP should use alternate‐opcode vectorization. |
|
Return true if a scalar epilogue should still be considered for vectorization. |
|
Return true if equal‐cost fixed‐width vectorization is preferred. |
|
Return true if reductions of |
|
Return true if a predicated reduction select should stay in the loop. |
|
Return true if SLP should apply the 2‐element instruction‐count check. |
|
Query the target whether it would be preferred to create a tail‐folded vector loop, which can avoid the need to emit a scalar epilogue loop. |
|
Return true if complex constants should stay attached to |
|
Return true if target doesn't mind addresses in vectors. |
|
Rewrite intrinsic |
|
Return true if switches should be turned into lookup tables for the target. |
|
Return true if switches should be turned into lookup tables containing this constant value for the target. |
|
Return true if lookup tables should be turned into relative lookup tables. |
|
Return true if address type promotion should be considered for |
|
Return true if VFs that exceed register pressure should be discarded. |
|
Return true if |
|
Return true if LSR should drop a found solution if it's calculated to be less profitable than the baseline. |
|
Return true if the reduction intrinsic should be expanded to shuffles. |
|
Return true if VF should match the smallest element type to a register. |
|
Return true if the target wants a prefetch in address space |
|
Return true if SelectOpt should treat |
|
Can be used to implement target‐specific instruction combining. |
|
Can be used to implement target‐specific instruction combining. |
|
Return true if vector element load/store is cheap enough to skip insert/extract. |
|
Return true if the target supports scalable vectors. |
|
If target supports tail call on |
|
If the target supports tail calls. |
|
Return true if alias analysis should be used in target‐specific transforms. |
|
Return true if the input function which is cold at all call sites, should use coldcc calling convention. |
|
Return true if the input function is internal, should use fastcc calling convention. |
Static Member Functions
Name |
Description |
Collect common data between two OperandValueInfo inputs. |
|
Calculates a CastContextHint from |
|
Get the cast opcode for an extension kind. |
|
Collect properties of V used in cost analysis, e.g. OP_PowerOf2. |
|
|
|
Calculates a VectorInstrContext from |
|
A helper function to determine the type of reduction algorithm used for a given |
Non-Member Functions
Name |
Description |
Return the cost associated with a callsite, including parameter passing and the call/return instruction. |
Created with MrDocs