comparison lib/Target/X86/X86TargetTransformInfo.h @ 95:afa8332a0e37 LLVM3.8

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
31 friend BaseT; 31 friend BaseT;
32 32
33 const X86Subtarget *ST; 33 const X86Subtarget *ST;
34 const X86TargetLowering *TLI; 34 const X86TargetLowering *TLI;
35 35
36 unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract); 36 int getScalarizationOverhead(Type *Ty, bool Insert, bool Extract);
37 37
38 const X86Subtarget *getST() const { return ST; } 38 const X86Subtarget *getST() const { return ST; }
39 const X86TargetLowering *getTLI() const { return TLI; } 39 const X86TargetLowering *getTLI() const { return TLI; }
40 40
41 public: 41 public:
42 explicit X86TTIImpl(const X86TargetMachine *TM, Function &F) 42 explicit X86TTIImpl(const X86TargetMachine *TM, const Function &F)
43 : BaseT(TM), ST(TM->getSubtargetImpl(F)), TLI(ST->getTargetLowering()) {} 43 : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
44 TLI(ST->getTargetLowering()) {}
44 45
45 // Provide value semantics. MSVC requires that we spell all of these out. 46 // Provide value semantics. MSVC requires that we spell all of these out.
46 X86TTIImpl(const X86TTIImpl &Arg) 47 X86TTIImpl(const X86TTIImpl &Arg)
47 : BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {} 48 : BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {}
48 X86TTIImpl(X86TTIImpl &&Arg) 49 X86TTIImpl(X86TTIImpl &&Arg)
49 : BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)), 50 : BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)),
50 TLI(std::move(Arg.TLI)) {} 51 TLI(std::move(Arg.TLI)) {}
51 X86TTIImpl &operator=(const X86TTIImpl &RHS) {
52 BaseT::operator=(static_cast<const BaseT &>(RHS));
53 ST = RHS.ST;
54 TLI = RHS.TLI;
55 return *this;
56 }
57 X86TTIImpl &operator=(X86TTIImpl &&RHS) {
58 BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
59 ST = std::move(RHS.ST);
60 TLI = std::move(RHS.TLI);
61 return *this;
62 }
63 52
64 /// \name Scalar TTI Implementations 53 /// \name Scalar TTI Implementations
65 /// @{ 54 /// @{
66 TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth); 55 TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth);
67 56
70 /// \name Vector TTI Implementations 59 /// \name Vector TTI Implementations
71 /// @{ 60 /// @{
72 61
73 unsigned getNumberOfRegisters(bool Vector); 62 unsigned getNumberOfRegisters(bool Vector);
74 unsigned getRegisterBitWidth(bool Vector); 63 unsigned getRegisterBitWidth(bool Vector);
75 unsigned getMaxInterleaveFactor(); 64 unsigned getMaxInterleaveFactor(unsigned VF);
76 unsigned getArithmeticInstrCost( 65 int getArithmeticInstrCost(
77 unsigned Opcode, Type *Ty, 66 unsigned Opcode, Type *Ty,
78 TTI::OperandValueKind Opd1Info = TTI::OK_AnyValue, 67 TTI::OperandValueKind Opd1Info = TTI::OK_AnyValue,
79 TTI::OperandValueKind Opd2Info = TTI::OK_AnyValue, 68 TTI::OperandValueKind Opd2Info = TTI::OK_AnyValue,
80 TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None, 69 TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None,
81 TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None); 70 TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None);
82 unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, 71 int getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp);
83 Type *SubTp); 72 int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src);
84 unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src); 73 int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy);
85 unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy); 74 int getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index);
86 unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index); 75 int getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
87 unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, 76 unsigned AddressSpace);
88 unsigned AddressSpace); 77 int getMaskedMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
89 unsigned getMaskedMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, 78 unsigned AddressSpace);
90 unsigned AddressSpace);
91 79
92 unsigned getAddressComputationCost(Type *PtrTy, bool IsComplex); 80 int getAddressComputationCost(Type *PtrTy, bool IsComplex);
93 81
94 unsigned getReductionCost(unsigned Opcode, Type *Ty, bool IsPairwiseForm); 82 int getReductionCost(unsigned Opcode, Type *Ty, bool IsPairwiseForm);
95 83
96 unsigned getIntImmCost(int64_t); 84 int getIntImmCost(int64_t);
97 85
98 unsigned getIntImmCost(const APInt &Imm, Type *Ty); 86 int getIntImmCost(const APInt &Imm, Type *Ty);
99 87
100 unsigned getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm, 88 int getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty);
101 Type *Ty); 89 int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm,
102 unsigned getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, 90 Type *Ty);
103 Type *Ty);
104 bool isLegalMaskedLoad(Type *DataType, int Consecutive); 91 bool isLegalMaskedLoad(Type *DataType, int Consecutive);
105 bool isLegalMaskedStore(Type *DataType, int Consecutive); 92 bool isLegalMaskedStore(Type *DataType, int Consecutive);
93 bool areInlineCompatible(const Function *Caller,
94 const Function *Callee) const;
106 95
107 /// @} 96 /// @}
108 }; 97 };
109 98
110 } // end namespace llvm 99 } // end namespace llvm