OpenASIP  2.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
llvm::TCEStubTTIImpl Class Reference

#include <TCEStubTargetTransformInfo.hh>

Inheritance diagram for llvm::TCEStubTTIImpl:
Inheritance graph
Collaboration diagram for llvm::TCEStubTTIImpl:
Collaboration graph

Public Member Functions

 TCEStubTTIImpl (const TCEStubTargetMachine *TM, const Function &F)
 
unsigned getNumberOfRegisters (bool vector)
 
unsigned getRegisterBitWidth (bool vector) const
 
unsigned getMaxInterleaveFactor (unsigned VF)
 
unsigned getCastInstrCost (unsigned Opcode, Type *Dst, Type *Src, const Instruction *=nullptr)
 

Private Types

typedef BasicTTIImplBase< TCEStubTTIImplBaseT
 
typedef TargetTransformInfo TTI
 

Private Member Functions

const TCEStubSubTargetgetST () const
 
const TargetLowering * getTLI () const
 

Private Attributes

friend BaseT
 
const TCEStubTargetMachineTM
 
const TCEStubSubTargetST
 
const TargetLowering * TLI
 

Detailed Description

Definition at line 43 of file TCEStubTargetTransformInfo.hh.

Member Typedef Documentation

◆ BaseT

typedef BasicTTIImplBase<TCEStubTTIImpl> llvm::TCEStubTTIImpl::BaseT
private

Definition at line 44 of file TCEStubTargetTransformInfo.hh.

◆ TTI

typedef TargetTransformInfo llvm::TCEStubTTIImpl::TTI
private

Definition at line 45 of file TCEStubTargetTransformInfo.hh.

Constructor & Destructor Documentation

◆ TCEStubTTIImpl()

llvm::TCEStubTTIImpl::TCEStubTTIImpl ( const TCEStubTargetMachine TM,
const Function &  F 
)
inlineexplicit

Definition at line 57 of file TCEStubTargetTransformInfo.hh.

59  : BaseT(TM, F.getParent()->getDataLayout()),
60  TM(TM), ST(TM->getSubtargetImpl()) {}

Member Function Documentation

◆ getCastInstrCost()

unsigned TCEStubTTIImpl::getCastInstrCost ( unsigned  Opcode,
Type *  Dst,
Type *  Src,
const Instruction *  = nullptr 
)

Definition at line 92 of file TCEStubTargetTransformInfo.cc.

94  {
95  // TODO: Maybe use ADF/osal information to figure out real cost
96  // 1 selected at the moment because LLVM cost model assumed way too high
97  // cost for trunc/zext instructions. Too low value here might lead to
98  // vectorization of loop that would be better left in scalar form
99  return 1;
100 }

◆ getMaxInterleaveFactor()

unsigned TCEStubTTIImpl::getMaxInterleaveFactor ( unsigned  VF)

Definition at line 84 of file TCEStubTargetTransformInfo.cc.

84  {
85  // This means maximum loop unroll factor
86  // 2 because loopvectorizer requires >1
87  // TODO: find some way adjust this.
88  return 2;
89 }

◆ getNumberOfRegisters()

unsigned TCEStubTTIImpl::getNumberOfRegisters ( bool  vector)

Definition at line 59 of file TCEStubTargetTransformInfo.cc.

59  {
60  // without adf information we have no clue about registers
61  if (TM->ttaMach_ == NULL)
62  return 0;
63 
64  // Widest operand tells directly the widest register
65  unsigned widestOperand =
67 
68  return MachineInfo::numberOfRegisters(*(TM->ttaMach_), widestOperand);
69 }

References MachineInfo::findWidestOperand(), MachineInfo::numberOfRegisters(), TM, and llvm::TCEBaseTargetMachine::ttaMach_.

Here is the call graph for this function:

◆ getRegisterBitWidth()

unsigned TCEStubTTIImpl::getRegisterBitWidth ( bool  vector) const

Definition at line 72 of file TCEStubTargetTransformInfo.cc.

74 {
75  // without adf information we have no clue about registers
76  if (TM->ttaMach_ == NULL)
77  return 0;
78 
79  // Widest operand tells directly the widest register
80  return MachineInfo::findWidestOperand(*(TM->ttaMach_), vector);
81 }

References MachineInfo::findWidestOperand(), TM, and llvm::TCEBaseTargetMachine::ttaMach_.

Here is the call graph for this function:

◆ getST()

const TCEStubSubTarget* llvm::TCEStubTTIImpl::getST ( ) const
inlineprivate

Definition at line 51 of file TCEStubTargetTransformInfo.hh.

51 { return ST; }

References ST.

◆ getTLI()

const TargetLowering* llvm::TCEStubTTIImpl::getTLI ( ) const
inlineprivate

Definition at line 52 of file TCEStubTargetTransformInfo.hh.

52  {
53  return ST->getTargetLowering();
54  }

References llvm::TCEStubSubTarget::getTargetLowering(), and ST.

Here is the call graph for this function:

Member Data Documentation

◆ BaseT

Definition at line 46 of file TCEStubTargetTransformInfo.hh.

◆ ST

const TCEStubSubTarget* llvm::TCEStubTTIImpl::ST
private

Definition at line 49 of file TCEStubTargetTransformInfo.hh.

Referenced by getST(), and getTLI().

◆ TLI

const TargetLowering* llvm::TCEStubTTIImpl::TLI
private

Definition at line 50 of file TCEStubTargetTransformInfo.hh.

◆ TM

const TCEStubTargetMachine* llvm::TCEStubTTIImpl::TM
private

Definition at line 48 of file TCEStubTargetTransformInfo.hh.

Referenced by getNumberOfRegisters(), and getRegisterBitWidth().


The documentation for this class was generated from the following files:
llvm::TCEStubTTIImpl::ST
const TCEStubSubTarget * ST
Definition: TCEStubTargetTransformInfo.hh:49
llvm::TCEStubTargetMachine::getSubtargetImpl
const TCEStubSubTarget * getSubtargetImpl() const
Definition: TCEStubTargetMachine.hh:120
MachineInfo::findWidestOperand
static unsigned findWidestOperand(const TTAMachine::Machine &machine, bool vector)
Definition: MachineInfo.cc:566
llvm::TCEStubSubTarget::getTargetLowering
const TargetLowering * getTargetLowering() const
Definition: TCEStubSubTarget.hh:59
MachineInfo::numberOfRegisters
static unsigned numberOfRegisters(const TTAMachine::Machine &machine, unsigned width)
Definition: MachineInfo.cc:594
llvm::TCEStubTTIImpl::BaseT
BasicTTIImplBase< TCEStubTTIImpl > BaseT
Definition: TCEStubTargetTransformInfo.hh:44
llvm::TCEBaseTargetMachine::ttaMach_
const TTAMachine::Machine * ttaMach_
Definition: TCEStubTargetMachine.hh:92
llvm::TCEStubTTIImpl::TM
const TCEStubTargetMachine * TM
Definition: TCEStubTargetTransformInfo.hh:48