LLVM  7.0.0
SystemZTargetTransformInfo.h
Go to the documentation of this file.
1 //===-- SystemZTargetTransformInfo.h - SystemZ-specific TTI ---------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETTRANSFORMINFO_H
11 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETTRANSFORMINFO_H
12 
13 #include "SystemZTargetMachine.h"
16 
17 namespace llvm {
18 
19 class SystemZTTIImpl : public BasicTTIImplBase<SystemZTTIImpl> {
21  typedef TargetTransformInfo TTI;
22  friend BaseT;
23 
24  const SystemZSubtarget *ST;
25  const SystemZTargetLowering *TLI;
26 
27  const SystemZSubtarget *getST() const { return ST; }
28  const SystemZTargetLowering *getTLI() const { return TLI; }
29 
30  unsigned const LIBCALL_COST = 30;
31 
32 public:
33  explicit SystemZTTIImpl(const SystemZTargetMachine *TM, const Function &F)
34  : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
35  TLI(ST->getTargetLowering()) {}
36 
37  /// \name Scalar TTI Implementations
38  /// @{
39 
40  int getIntImmCost(const APInt &Imm, Type *Ty);
41 
42  int getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty);
43  int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm,
44  Type *Ty);
45 
46  TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth);
47 
50 
53  /// @}
54 
55  /// \name Vector TTI Implementations
56  /// @{
57 
58  unsigned getNumberOfRegisters(bool Vector);
59  unsigned getRegisterBitWidth(bool Vector) const;
60 
61  unsigned getCacheLineSize() { return 256; }
62  unsigned getPrefetchDistance() { return 2000; }
63  unsigned getMinPrefetchStride() { return 2048; }
64 
65  bool hasDivRemOp(Type *DataType, bool IsSigned);
66  bool prefersVectorizedAddressing() { return false; }
67  bool LSRWithInstrQueries() { return true; }
69  bool enableInterleavedAccessVectorization() { return true; }
70 
72  unsigned Opcode, Type *Ty,
78  int getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp);
79  unsigned getVectorTruncCost(Type *SrcTy, Type *DstTy);
80  unsigned getVectorBitmaskConversionCost(Type *SrcTy, Type *DstTy);
81  int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
82  const Instruction *I = nullptr);
83  int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
84  const Instruction *I = nullptr);
85  int getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index);
86  int getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
87  unsigned AddressSpace, const Instruction *I = nullptr);
88 
89  int getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy,
90  unsigned Factor,
91  ArrayRef<unsigned> Indices,
92  unsigned Alignment,
93  unsigned AddressSpace);
94  /// @}
95 };
96 
97 } // end namespace llvm
98 
99 #endif
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
int getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, unsigned Alignment, unsigned AddressSpace)
unsigned getVectorTruncCost(Type *SrcTy, Type *DstTy)
SystemZTTIImpl(const SystemZTargetMachine *TM, const Function &F)
bool isLSRCostLess(TargetTransformInfo::LSRCost &C1, TargetTransformInfo::LSRCost &C2)
The main scalar evolution driver.
F(f)
Base class which can be used to help build a TTI implementation.
Definition: BasicTTIImpl.h:78
TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth)
int getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp)
unsigned getNumberOfRegisters(bool Vector)
PopcntSupportKind
Flags indicating the kind of support for population count.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP)
int getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, unsigned AddressSpace, const Instruction *I=nullptr)
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
bool hasDivRemOp(Type *DataType, bool IsSigned)
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy, const Instruction *I=nullptr)
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
OperandValueProperties
Additional properties of an operand&#39;s values.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
unsigned getRegisterBitWidth(bool Vector) const
AddressSpace
Definition: NVPTXBaseInfo.h:22
int getIntImmCost(const APInt &Imm, Type *Ty)
Class for arbitrary precision integers.
Definition: APInt.h:69
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:459
Parameters that control the generic loop unrolling transformation.
int getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index)
#define I(x, y, z)
Definition: MD5.cpp:58
const unsigned Kind
static const Function * getParent(const Value *V)
const DataLayout & getDataLayout() const
OperandValueKind
Additional information about an operand&#39;s possible values.
This pass exposes codegen information to IR-level passes.
int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, const Instruction *I=nullptr)
int getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::OperandValueKind Opd1Info=TTI::OK_AnyValue, TTI::OperandValueKind Opd2Info=TTI::OK_AnyValue, TTI::OperandValueProperties Opd1PropInfo=TTI::OP_None, TTI::OperandValueProperties Opd2PropInfo=TTI::OP_None, ArrayRef< const Value *> Args=ArrayRef< const Value *>())
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
ShuffleKind
The various kinds of shuffle patterns for vector queries.
unsigned getVectorBitmaskConversionCost(Type *SrcTy, Type *DstTy)