LLVM: lib/Target/Hexagon/HexagonTargetTransformInfo.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETTRANSFORMINFO_H

16#define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETTRANSFORMINFO_H

17

25

26namespace llvm {

27

32

36

37 friend BaseT;

38

41

44

45 bool useHVX() const;

46 bool isHVXVectorType(Type *Ty) const;

47

48

49

50

51 unsigned getTypeNumElements(Type *Ty) const;

52

53public:

56 ST(*TM->getSubtargetImpl(F)), TLI(*ST.getTargetLowering()) {}

57

58

59

60

63

64

68

71

72

75

76

79

80

81

82

83

84

91

107

121 const Instruction *I = nullptr) const override;

126 const Instruction *CxtI = nullptr) const override;

128 unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef Indices,

130 bool UseMaskForCond = false, bool UseMaskForGaps = false) const override;

136 const Instruction *I = nullptr) const override;

142 const Instruction *CxtI = nullptr) const override;

146 const Instruction *I = nullptr) const override;

150 unsigned Index, const Value *Op0,

151 const Value *Op1) const override;

152

155 const Instruction *I = nullptr) const override {

156 return 1;

157 }

158

167 Align Alignment) const override;

169 Align Alignment) const override;

170

171

172

176

177

179};

180

181}

182#endif

This file provides a helper that implements much of the TTI interface in terms of the target-independ...

static cl::opt< OutputCostKind > CostKind("cost-kind", cl::desc("Target cost kind"), cl::init(OutputCostKind::RecipThroughput), cl::values(clEnumValN(OutputCostKind::RecipThroughput, "throughput", "Reciprocal throughput"), clEnumValN(OutputCostKind::Latency, "latency", "Instruction latency"), clEnumValN(OutputCostKind::CodeSize, "code-size", "Code size"), clEnumValN(OutputCostKind::SizeAndLatency, "size-latency", "Code size and latency"), clEnumValN(OutputCostKind::All, "all", "Print all cost kinds")))

This pass exposes codegen information to IR-level passes.

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, const Value *Op0, const Value *Op1) const override

BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)

Predicate

This enumeration lists the possible predicates for CmpInst subclasses.

InstructionCost getCFInstrCost(unsigned Opcode, TTI::TargetCostKind CostKind, const Instruction *I=nullptr) const override

Definition HexagonTargetTransformInfo.h:154

InstructionCost getMemoryOpCost(unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, TTI::OperandValueInfo OpInfo={TTI::OK_AnyValue, TTI::OP_None}, const Instruction *I=nullptr) const override

bool forceScalarizeMaskedScatter(VectorType *VTy, Align Alignment) const override

bool isLegalMaskedStore(Type *DataType, Align Alignment, unsigned AddressSpace, TTI::MaskKind MaskKind) const override

ElementCount getMinimumVF(unsigned ElemWidth, bool IsScalable) const override

InstructionCost getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, TTI::CastContextHint CCH, TTI::TargetCostKind CostKind, const Instruction *I=nullptr) const override

bool forceScalarizeMaskedGather(VectorType *VTy, Align Alignment) const override

bool shouldMaximizeVectorBandwidth(TargetTransformInfo::RegisterKind K) const override

Definition HexagonTargetTransformInfo.h:92

InstructionCost getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, bool UseMaskForCond=false, bool UseMaskForGaps=false) const override

unsigned getNumberOfRegisters(unsigned ClassID) const override

— Vector TTI begin —

InstructionCost getAddressComputationCost(Type *PtrTy, ScalarEvolution *SE, const SCEV *S, TTI::TargetCostKind CostKind) const override

InstructionCost getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Op1Info={TTI::OK_AnyValue, TTI::OP_None}, TTI::OperandValueInfo Op2Info={TTI::OK_AnyValue, TTI::OP_None}, ArrayRef< const Value * > Args={}, const Instruction *CxtI=nullptr) const override

TTI::PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) const override

unsigned getMinVectorRegisterBitWidth() const override

bool enableAggressiveInterleaving(bool LoopHasReductions) const override

Definition HexagonTargetTransformInfo.h:102

bool isLegalMaskedLoad(Type *DataType, Align Alignment, unsigned AddressSpace, TTI::MaskKind MaskKind) const override

bool isLegalMaskedGather(Type *Ty, Align Alignment) const override

TypeSize getRegisterBitWidth(TargetTransformInfo::RegisterKind K) const override

bool supportsEfficientVectorElementLoadStore() const override

Definition HexagonTargetTransformInfo.h:96

InstructionCost getCallInstrCost(Function *F, Type *RetTy, ArrayRef< Type * > Tys, TTI::TargetCostKind CostKind) const override

Compute a cost of the given call instruction.

void getPeelingPreferences(Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP) const override

HexagonTTIImpl(const HexagonTargetMachine *TM, const Function &F)

Definition HexagonTargetTransformInfo.h:54

InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, const Value *Op0, const Value *Op1) const override

InstructionCost getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind) const override

Get intrinsic cost based on arguments.

InstructionCost getShuffleCost(TTI::ShuffleKind Kind, VectorType *DstTy, VectorType *SrcTy, ArrayRef< int > Mask, TTI::TargetCostKind CostKind, int Index, VectorType *SubTp, ArrayRef< const Value * > Args={}, const Instruction *CxtI=nullptr) const override

bool prefersVectorizedAddressing() const override

Definition HexagonTargetTransformInfo.h:105

TTI::AddressingModeKind getPreferredAddressingMode(const Loop *L, ScalarEvolution *SE) const override

Bias LSR towards creating post-increment opportunities.

bool shouldBuildLookupTables() const override

bool enableInterleavedAccessVectorization() const override

Definition HexagonTargetTransformInfo.h:106

unsigned getMaxInterleaveFactor(ElementCount VF) const override

bool isLegalMaskedScatter(Type *Ty, Align Alignment) const override

InstructionCost getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy, CmpInst::Predicate VecPred, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Op1Info={TTI::OK_AnyValue, TTI::OP_None}, TTI::OperandValueInfo Op2Info={TTI::OK_AnyValue, TTI::OP_None}, const Instruction *I=nullptr) const override

InstructionCost getInstructionCost(const User *U, ArrayRef< const Value * > Operands, TTI::TargetCostKind CostKind) const override

void getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP, OptimizationRemarkEmitter *ORE) const override

unsigned getCacheLineSize() const override

unsigned getPrefetchDistance() const override

— Vector TTI end —

bool hasBranchDivergence(const Function *F=nullptr) const override

Definition HexagonTargetTransformInfo.h:99

Represents a single loop in the control flow graph.

This class represents an analyzed expression in the program.

The main scalar evolution driver.

virtual const DataLayout & getDataLayout() const

This pass provides access to the codegen interfaces that are needed for IR-level transformations.

MaskKind

Some targets only support masked load/store with a constant mask.

TargetCostKind

The kind of cost model.

PopcntSupportKind

Flags indicating the kind of support for population count.

AddressingModeKind

Which addressing mode Loop Strength Reduction will try to generate.

ShuffleKind

The various kinds of shuffle patterns for vector queries.

CastContextHint

Represents a hint about the context in which a cast is used.

The instances of the Type class are immutable: once they are created, they are never changed.

LLVM Value Representation.

Base class of all SIMD vector types.

constexpr char Args[]

Key for Kernel::Metadata::mArgs.

friend class Instruction

Iterator for Instructions in a `BasicBlock.

This is an optimization pass for GlobalISel generic memory operations.

FunctionAddr VTableAddr Value

ArrayRef(const T &OneElt) -> ArrayRef< T >

This struct is a compact representation of a valid (non-zero power of two) alignment.

Parameters that control the generic loop unrolling transformation.