OpenASIP  2.0
TCEStubTargetTransformInfo.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2015 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 /**
25  * @file TCEStubTargeTransformInfo.hh
26  *
27  * Declaration of TCEStubTargetTransformInfo class.
28  *
29  * @author Ville Korhonen 2015
30  */
31 
32 #ifndef TTA_TCE_TARGET_TRANSFORM_INFO_HH
33 #define TTA_TCE_TARGET_TRANSFORM_INFO_HH
34 
35 #include <llvm/Analysis/TargetTransformInfo.h>
36 #include <llvm/CodeGen/BasicTTIImpl.h>
38 #include "TCEStubTargetMachine.hh"
39 #include "TCEStubSubTarget.hh"
40 
41 namespace llvm {
42 
43  class TCEStubTTIImpl : public BasicTTIImplBase<TCEStubTTIImpl> {
44  typedef BasicTTIImplBase<TCEStubTTIImpl> BaseT;
45  typedef TargetTransformInfo TTI;
46  friend BaseT;
47 
50  const TargetLowering *TLI;
51  const TCEStubSubTarget *getST() const { return ST; }
52  const TargetLowering *getTLI() const {
53  return ST->getTargetLowering();
54  }
55 
56  public:
58  const Function &F)
59  : BaseT(TM, F.getParent()->getDataLayout()),
60  TM(TM), ST(TM->getSubtargetImpl()) {}
61 
62  unsigned getNumberOfRegisters(bool vector);
63  unsigned getRegisterBitWidth(bool vector) const;
64  unsigned getMaxInterleaveFactor(unsigned VF);
65  unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src
66  , const Instruction* = nullptr
67  );
68  };
69 }
70 
71 #endif
llvm
Definition: InlineAsmParser.hh:49
llvm::TCEStubTargetMachine
Definition: TCEStubTargetMachine.hh:102
llvm::TCEStubTTIImpl::ST
const TCEStubSubTarget * ST
Definition: TCEStubTargetTransformInfo.hh:49
llvm::TCEStubTTIImpl::getRegisterBitWidth
unsigned getRegisterBitWidth(bool vector) const
Definition: TCEStubTargetTransformInfo.cc:72
llvm::TCEStubTTIImpl::getMaxInterleaveFactor
unsigned getMaxInterleaveFactor(unsigned VF)
Definition: TCEStubTargetTransformInfo.cc:84
llvm::TCEStubTTIImpl::TTI
TargetTransformInfo TTI
Definition: TCEStubTargetTransformInfo.hh:45
llvm::TCEStubTTIImpl::TLI
const TargetLowering * TLI
Definition: TCEStubTargetTransformInfo.hh:50
llvm::TCEStubTTIImpl::getST
const TCEStubSubTarget * getST() const
Definition: TCEStubTargetTransformInfo.hh:51
llvm::TCEStubTTIImpl::BaseT
friend BaseT
Definition: TCEStubTargetTransformInfo.hh:46
llvm::TCEStubTTIImpl::TCEStubTTIImpl
TCEStubTTIImpl(const TCEStubTargetMachine *TM, const Function &F)
Definition: TCEStubTargetTransformInfo.hh:57
llvm::TCEStubTTIImpl::getCastInstrCost
unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, const Instruction *=nullptr)
Definition: TCEStubTargetTransformInfo.cc:92
llvm::TCEStubSubTarget::getTargetLowering
const TargetLowering * getTargetLowering() const
Definition: TCEStubSubTarget.hh:59
llvm::TCEStubSubTarget
Definition: TCEStubSubTarget.hh:51
llvm::TCEStubTTIImpl::BaseT
BasicTTIImplBase< TCEStubTTIImpl > BaseT
Definition: TCEStubTargetTransformInfo.hh:44
TCEStubTargetMachine.hh
llvm::TCEStubTTIImpl::getTLI
const TargetLowering * getTLI() const
Definition: TCEStubTargetTransformInfo.hh:52
TCEStubSubTarget.hh
TCEStubTargetTransformInfo.hh
llvm::TCEStubTTIImpl
Definition: TCEStubTargetTransformInfo.hh:43
llvm::TCEStubTTIImpl::TM
const TCEStubTargetMachine * TM
Definition: TCEStubTargetTransformInfo.hh:48
llvm::TCEStubTTIImpl::getNumberOfRegisters
unsigned getNumberOfRegisters(bool vector)
Definition: TCEStubTargetTransformInfo.cc:59