Mercurial > hg > Members > tobaru > cbc > CbC_llvm
comparison lib/Target/PowerPC/PPCTargetTransformInfo.h @ 95:afa8332a0e37
LLVM 3.8
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 13 Oct 2015 17:48:58 +0900 |
parents | 60c9769439b8 |
children | 7d135dc70f03 |
comparison
equal
deleted
inserted
replaced
84:f3e34b893a5f | 95:afa8332a0e37 |
---|---|
35 | 35 |
36 const PPCSubtarget *getST() const { return ST; } | 36 const PPCSubtarget *getST() const { return ST; } |
37 const PPCTargetLowering *getTLI() const { return TLI; } | 37 const PPCTargetLowering *getTLI() const { return TLI; } |
38 | 38 |
39 public: | 39 public: |
40 explicit PPCTTIImpl(const PPCTargetMachine *TM, Function &F) | 40 explicit PPCTTIImpl(const PPCTargetMachine *TM, const Function &F) |
41 : BaseT(TM), ST(TM->getSubtargetImpl(F)), TLI(ST->getTargetLowering()) {} | 41 : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)), |
42 TLI(ST->getTargetLowering()) {} | |
42 | 43 |
43 // Provide value semantics. MSVC requires that we spell all of these out. | 44 // Provide value semantics. MSVC requires that we spell all of these out. |
44 PPCTTIImpl(const PPCTTIImpl &Arg) | 45 PPCTTIImpl(const PPCTTIImpl &Arg) |
45 : BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {} | 46 : BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {} |
46 PPCTTIImpl(PPCTTIImpl &&Arg) | 47 PPCTTIImpl(PPCTTIImpl &&Arg) |
47 : BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)), | 48 : BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)), |
48 TLI(std::move(Arg.TLI)) {} | 49 TLI(std::move(Arg.TLI)) {} |
49 PPCTTIImpl &operator=(const PPCTTIImpl &RHS) { | |
50 BaseT::operator=(static_cast<const BaseT &>(RHS)); | |
51 ST = RHS.ST; | |
52 TLI = RHS.TLI; | |
53 return *this; | |
54 } | |
55 PPCTTIImpl &operator=(PPCTTIImpl &&RHS) { | |
56 BaseT::operator=(std::move(static_cast<BaseT &>(RHS))); | |
57 ST = std::move(RHS.ST); | |
58 TLI = std::move(RHS.TLI); | |
59 return *this; | |
60 } | |
61 | 50 |
62 /// \name Scalar TTI Implementations | 51 /// \name Scalar TTI Implementations |
63 /// @{ | 52 /// @{ |
64 | 53 |
65 using BaseT::getIntImmCost; | 54 using BaseT::getIntImmCost; |
66 unsigned getIntImmCost(const APInt &Imm, Type *Ty); | 55 int getIntImmCost(const APInt &Imm, Type *Ty); |
67 | 56 |
68 unsigned getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm, | 57 int getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty); |
69 Type *Ty); | 58 int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, |
70 unsigned getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, | 59 Type *Ty); |
71 Type *Ty); | |
72 | 60 |
73 TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth); | 61 TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth); |
74 void getUnrollingPreferences(Loop *L, TTI::UnrollingPreferences &UP); | 62 void getUnrollingPreferences(Loop *L, TTI::UnrollingPreferences &UP); |
75 | 63 |
76 /// @} | 64 /// @} |
77 | 65 |
78 /// \name Vector TTI Implementations | 66 /// \name Vector TTI Implementations |
79 /// @{ | 67 /// @{ |
80 | 68 |
69 bool enableAggressiveInterleaving(bool LoopHasReductions); | |
70 bool enableInterleavedAccessVectorization(); | |
81 unsigned getNumberOfRegisters(bool Vector); | 71 unsigned getNumberOfRegisters(bool Vector); |
82 unsigned getRegisterBitWidth(bool Vector); | 72 unsigned getRegisterBitWidth(bool Vector); |
83 unsigned getMaxInterleaveFactor(); | 73 unsigned getMaxInterleaveFactor(unsigned VF); |
84 unsigned getArithmeticInstrCost( | 74 int getArithmeticInstrCost( |
85 unsigned Opcode, Type *Ty, | 75 unsigned Opcode, Type *Ty, |
86 TTI::OperandValueKind Opd1Info = TTI::OK_AnyValue, | 76 TTI::OperandValueKind Opd1Info = TTI::OK_AnyValue, |
87 TTI::OperandValueKind Opd2Info = TTI::OK_AnyValue, | 77 TTI::OperandValueKind Opd2Info = TTI::OK_AnyValue, |
88 TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None, | 78 TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None, |
89 TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None); | 79 TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None); |
90 unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, | 80 int getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp); |
91 Type *SubTp); | 81 int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src); |
92 unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src); | 82 int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy); |
93 unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy); | 83 int getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index); |
94 unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index); | 84 int getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, |
95 unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, | 85 unsigned AddressSpace); |
96 unsigned AddressSpace); | 86 int getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, |
87 unsigned Factor, | |
88 ArrayRef<unsigned> Indices, | |
89 unsigned Alignment, | |
90 unsigned AddressSpace); | |
97 | 91 |
98 /// @} | 92 /// @} |
99 }; | 93 }; |
100 | 94 |
101 } // end namespace llvm | 95 } // end namespace llvm |