forked from OSchip/llvm-project
[multiversion] Remove the cached TargetMachine pointer from the
intermediate TTI implementation template and instead query up to the derived class for both the TargetMachine and the TargetLowering. Most of the derived types had a TLI cached already and there is no need to store a less precisely typed target machine pointer. This will in turn make it much cleaner to look up the TLI via a per-function subtarget instead of the generic subtarget, and it will pave the way toward pulling the subtarget used for unroll preferences into the same form once we are *always* using the function to look up the correct subtarget. llvm-svn: 227737
This commit is contained in:
parent
0ef5e39166
commit
c340ca839c
llvm
include/llvm/CodeGen
lib
|
@ -26,6 +26,15 @@ namespace llvm {
|
||||||
|
|
||||||
extern cl::opt<unsigned> PartialUnrollingThreshold;
|
extern cl::opt<unsigned> PartialUnrollingThreshold;
|
||||||
|
|
||||||
|
/// \brief Base class which can be used to help build a TTI implementation.
|
||||||
|
///
|
||||||
|
/// This class provides as much implementation of the TTI interface as is
|
||||||
|
/// possible using the target independent parts of the code generator.
|
||||||
|
///
|
||||||
|
/// In order to subclass it, your class must implement a getTM() method to
|
||||||
|
/// return the target machine, and a getTLI() method to return the target
|
||||||
|
/// lowering. We need these methods implemented in the derived class so that
|
||||||
|
/// this class doesn't have to duplicate storage for them.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
|
class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
|
||||||
private:
|
private:
|
||||||
|
@ -70,30 +79,32 @@ private:
|
||||||
return Cost;
|
return Cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// \brief Local query method delegates up to T which *must* implement this!
|
||||||
|
const TargetMachine *getTM() const {
|
||||||
|
return static_cast<const T *>(this)->getTM();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// \brief Local query method delegates up to T which *must* implement this!
|
||||||
const TargetLoweringBase *getTLI() const {
|
const TargetLoweringBase *getTLI() const {
|
||||||
return TM->getSubtargetImpl()->getTargetLowering();
|
return static_cast<const T *>(this)->getTLI();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const TargetMachine *TM;
|
|
||||||
|
|
||||||
explicit BasicTTIImplBase(const TargetMachine *TM)
|
explicit BasicTTIImplBase(const TargetMachine *TM)
|
||||||
: BaseT(TM->getDataLayout()), TM(TM) {}
|
: BaseT(TM->getDataLayout()) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Provide value semantics. MSVC requires that we spell all of these out.
|
// Provide value semantics. MSVC requires that we spell all of these out.
|
||||||
BasicTTIImplBase(const BasicTTIImplBase &Arg)
|
BasicTTIImplBase(const BasicTTIImplBase &Arg)
|
||||||
: BaseT(static_cast<const BaseT &>(Arg)), TM(Arg.TM) {}
|
: BaseT(static_cast<const BaseT &>(Arg)) {}
|
||||||
BasicTTIImplBase(BasicTTIImplBase &&Arg)
|
BasicTTIImplBase(BasicTTIImplBase &&Arg)
|
||||||
: BaseT(std::move(static_cast<BaseT &>(Arg))), TM(std::move(Arg.TM)) {}
|
: BaseT(std::move(static_cast<BaseT &>(Arg))) {}
|
||||||
BasicTTIImplBase &operator=(const BasicTTIImplBase &RHS) {
|
BasicTTIImplBase &operator=(const BasicTTIImplBase &RHS) {
|
||||||
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
||||||
TM = RHS.TM;
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
BasicTTIImplBase &operator=(BasicTTIImplBase &&RHS) {
|
BasicTTIImplBase &operator=(BasicTTIImplBase &&RHS) {
|
||||||
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
||||||
TM = std::move(RHS.TM);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +193,7 @@ public:
|
||||||
// until someone finds a case where it matters in practice.
|
// until someone finds a case where it matters in practice.
|
||||||
|
|
||||||
unsigned MaxOps;
|
unsigned MaxOps;
|
||||||
const TargetSubtargetInfo *ST = TM->getSubtargetImpl(*F);
|
const TargetSubtargetInfo *ST = getTM()->getSubtargetImpl(*F);
|
||||||
if (PartialUnrollingThreshold.getNumOccurrences() > 0)
|
if (PartialUnrollingThreshold.getNumOccurrences() > 0)
|
||||||
MaxOps = PartialUnrollingThreshold;
|
MaxOps = PartialUnrollingThreshold;
|
||||||
else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
|
else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
|
||||||
|
@ -626,21 +637,33 @@ public:
|
||||||
/// is needed.
|
/// is needed.
|
||||||
class BasicTTIImpl : public BasicTTIImplBase<BasicTTIImpl> {
|
class BasicTTIImpl : public BasicTTIImplBase<BasicTTIImpl> {
|
||||||
typedef BasicTTIImplBase<BasicTTIImpl> BaseT;
|
typedef BasicTTIImplBase<BasicTTIImpl> BaseT;
|
||||||
|
friend class BasicTTIImplBase<BasicTTIImpl>;
|
||||||
|
|
||||||
|
const TargetMachine *TM;
|
||||||
|
const TargetLoweringBase *TLI;
|
||||||
|
|
||||||
|
const TargetMachine *getTM() const { return TM; }
|
||||||
|
const TargetLoweringBase *getTLI() const { return TLI; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BasicTTIImpl(const TargetMachine *TM);
|
explicit BasicTTIImpl(const TargetMachine *TM);
|
||||||
|
|
||||||
// Provide value semantics. MSVC requires that we spell all of these out.
|
// Provide value semantics. MSVC requires that we spell all of these out.
|
||||||
BasicTTIImpl(const BasicTTIImpl &Arg)
|
BasicTTIImpl(const BasicTTIImpl &Arg)
|
||||||
: BaseT(static_cast<const BaseT &>(Arg)) {}
|
: BaseT(static_cast<const BaseT &>(Arg)), TM(Arg.TM), TLI(Arg.TLI) {}
|
||||||
BasicTTIImpl(BasicTTIImpl &&Arg)
|
BasicTTIImpl(BasicTTIImpl &&Arg)
|
||||||
: BaseT(std::move(static_cast<BaseT &>(Arg))) {}
|
: BaseT(std::move(static_cast<BaseT &>(Arg))), TM(std::move(Arg.TM)),
|
||||||
|
TLI(std::move(Arg.TLI)) {}
|
||||||
BasicTTIImpl &operator=(const BasicTTIImpl &RHS) {
|
BasicTTIImpl &operator=(const BasicTTIImpl &RHS) {
|
||||||
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
||||||
|
TM = RHS.TM;
|
||||||
|
TLI = RHS.TLI;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
BasicTTIImpl &operator=(BasicTTIImpl &&RHS) {
|
BasicTTIImpl &operator=(BasicTTIImpl &&RHS) {
|
||||||
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
||||||
|
TM = std::move(RHS.TM);
|
||||||
|
TLI = std::move(RHS.TLI);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,4 +33,5 @@ cl::opt<unsigned>
|
||||||
cl::desc("Threshold for partial unrolling"),
|
cl::desc("Threshold for partial unrolling"),
|
||||||
cl::Hidden);
|
cl::Hidden);
|
||||||
|
|
||||||
BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM) : BaseT(TM) {}
|
BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM)
|
||||||
|
: BaseT(TM), TM(TM), TLI(TM->getSubtargetImpl()->getTargetLowering()) {}
|
||||||
|
|
|
@ -29,7 +29,9 @@ namespace llvm {
|
||||||
class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
|
class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
|
||||||
typedef BasicTTIImplBase<AArch64TTIImpl> BaseT;
|
typedef BasicTTIImplBase<AArch64TTIImpl> BaseT;
|
||||||
typedef TargetTransformInfo TTI;
|
typedef TargetTransformInfo TTI;
|
||||||
|
friend BaseT;
|
||||||
|
|
||||||
|
const AArch64TargetMachine *TM;
|
||||||
const AArch64Subtarget *ST;
|
const AArch64Subtarget *ST;
|
||||||
const AArch64TargetLowering *TLI;
|
const AArch64TargetLowering *TLI;
|
||||||
|
|
||||||
|
@ -37,6 +39,9 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
|
||||||
/// are set if the result needs to be inserted and/or extracted from vectors.
|
/// are set if the result needs to be inserted and/or extracted from vectors.
|
||||||
unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract);
|
unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract);
|
||||||
|
|
||||||
|
const AArch64TargetMachine *getTM() const { return TM; }
|
||||||
|
const AArch64TargetLowering *getTLI() const { return TLI; }
|
||||||
|
|
||||||
enum MemIntrinsicType {
|
enum MemIntrinsicType {
|
||||||
VECTOR_LDST_TWO_ELEMENTS,
|
VECTOR_LDST_TWO_ELEMENTS,
|
||||||
VECTOR_LDST_THREE_ELEMENTS,
|
VECTOR_LDST_THREE_ELEMENTS,
|
||||||
|
@ -45,22 +50,26 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AArch64TTIImpl(const AArch64TargetMachine *TM, Function &F)
|
explicit AArch64TTIImpl(const AArch64TargetMachine *TM, Function &F)
|
||||||
: BaseT(TM), ST(TM->getSubtargetImpl(F)), TLI(ST->getTargetLowering()) {}
|
: BaseT(TM), TM(TM), ST(TM->getSubtargetImpl(F)),
|
||||||
|
TLI(ST->getTargetLowering()) {}
|
||||||
|
|
||||||
// Provide value semantics. MSVC requires that we spell all of these out.
|
// Provide value semantics. MSVC requires that we spell all of these out.
|
||||||
AArch64TTIImpl(const AArch64TTIImpl &Arg)
|
AArch64TTIImpl(const AArch64TTIImpl &Arg)
|
||||||
: BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {}
|
: BaseT(static_cast<const BaseT &>(Arg)), TM(Arg.TM), ST(Arg.ST),
|
||||||
|
TLI(Arg.TLI) {}
|
||||||
AArch64TTIImpl(AArch64TTIImpl &&Arg)
|
AArch64TTIImpl(AArch64TTIImpl &&Arg)
|
||||||
: BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)),
|
: BaseT(std::move(static_cast<BaseT &>(Arg))), TM(std::move(Arg.TM)),
|
||||||
TLI(std::move(Arg.TLI)) {}
|
ST(std::move(Arg.ST)), TLI(std::move(Arg.TLI)) {}
|
||||||
AArch64TTIImpl &operator=(const AArch64TTIImpl &RHS) {
|
AArch64TTIImpl &operator=(const AArch64TTIImpl &RHS) {
|
||||||
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
||||||
|
TM = RHS.TM;
|
||||||
ST = RHS.ST;
|
ST = RHS.ST;
|
||||||
TLI = RHS.TLI;
|
TLI = RHS.TLI;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
AArch64TTIImpl &operator=(AArch64TTIImpl &&RHS) {
|
AArch64TTIImpl &operator=(AArch64TTIImpl &&RHS) {
|
||||||
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
||||||
|
TM = std::move(RHS.TM);
|
||||||
ST = std::move(RHS.ST);
|
ST = std::move(RHS.ST);
|
||||||
TLI = std::move(RHS.TLI);
|
TLI = std::move(RHS.TLI);
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -28,7 +28,9 @@ namespace llvm {
|
||||||
class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {
|
class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {
|
||||||
typedef BasicTTIImplBase<ARMTTIImpl> BaseT;
|
typedef BasicTTIImplBase<ARMTTIImpl> BaseT;
|
||||||
typedef TargetTransformInfo TTI;
|
typedef TargetTransformInfo TTI;
|
||||||
|
friend BaseT;
|
||||||
|
|
||||||
|
const ARMBaseTargetMachine *TM;
|
||||||
const ARMSubtarget *ST;
|
const ARMSubtarget *ST;
|
||||||
const ARMTargetLowering *TLI;
|
const ARMTargetLowering *TLI;
|
||||||
|
|
||||||
|
@ -36,24 +38,30 @@ class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {
|
||||||
/// are set if the result needs to be inserted and/or extracted from vectors.
|
/// are set if the result needs to be inserted and/or extracted from vectors.
|
||||||
unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract);
|
unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract);
|
||||||
|
|
||||||
|
const ARMBaseTargetMachine *getTM() const { return TM; }
|
||||||
|
const ARMTargetLowering *getTLI() const { return TLI; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ARMTTIImpl(const ARMBaseTargetMachine *TM, Function &F)
|
explicit ARMTTIImpl(const ARMBaseTargetMachine *TM, Function &F)
|
||||||
: BaseT(TM), ST(TM->getSubtargetImpl(F)), TLI(ST->getTargetLowering()) {}
|
: BaseT(TM), TM(TM), ST(TM->getSubtargetImpl(F)),
|
||||||
|
TLI(ST->getTargetLowering()) {}
|
||||||
|
|
||||||
// Provide value semantics. MSVC requires that we spell all of these out.
|
// Provide value semantics. MSVC requires that we spell all of these out.
|
||||||
ARMTTIImpl(const ARMTTIImpl &Arg)
|
ARMTTIImpl(const ARMTTIImpl &Arg)
|
||||||
: BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {}
|
: BaseT(static_cast<const BaseT &>(Arg)), TM(Arg.TM), ST(Arg.ST), TLI(Arg.TLI) {}
|
||||||
ARMTTIImpl(ARMTTIImpl &&Arg)
|
ARMTTIImpl(ARMTTIImpl &&Arg)
|
||||||
: BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)),
|
: BaseT(std::move(static_cast<BaseT &>(Arg))), TM(std::move(Arg.TM)),
|
||||||
TLI(std::move(Arg.TLI)) {}
|
ST(std::move(Arg.ST)), TLI(std::move(Arg.TLI)) {}
|
||||||
ARMTTIImpl &operator=(const ARMTTIImpl &RHS) {
|
ARMTTIImpl &operator=(const ARMTTIImpl &RHS) {
|
||||||
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
||||||
|
TM = RHS.TM;
|
||||||
ST = RHS.ST;
|
ST = RHS.ST;
|
||||||
TLI = RHS.TLI;
|
TLI = RHS.TLI;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
ARMTTIImpl &operator=(ARMTTIImpl &&RHS) {
|
ARMTTIImpl &operator=(ARMTTIImpl &&RHS) {
|
||||||
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
||||||
|
TM = std::move(RHS.TM);
|
||||||
ST = std::move(RHS.ST);
|
ST = std::move(RHS.ST);
|
||||||
TLI = std::move(RHS.TLI);
|
TLI = std::move(RHS.TLI);
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -28,25 +28,32 @@ namespace llvm {
|
||||||
class NVPTXTTIImpl : public BasicTTIImplBase<NVPTXTTIImpl> {
|
class NVPTXTTIImpl : public BasicTTIImplBase<NVPTXTTIImpl> {
|
||||||
typedef BasicTTIImplBase<NVPTXTTIImpl> BaseT;
|
typedef BasicTTIImplBase<NVPTXTTIImpl> BaseT;
|
||||||
typedef TargetTransformInfo TTI;
|
typedef TargetTransformInfo TTI;
|
||||||
|
friend BaseT;
|
||||||
|
|
||||||
|
const NVPTXTargetMachine *TM;
|
||||||
const NVPTXTargetLowering *TLI;
|
const NVPTXTargetLowering *TLI;
|
||||||
|
|
||||||
|
const NVPTXTargetMachine *getTM() const { return TM; };
|
||||||
|
const NVPTXTargetLowering *getTLI() const { return TLI; };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit NVPTXTTIImpl(const NVPTXTargetMachine *TM)
|
explicit NVPTXTTIImpl(const NVPTXTargetMachine *TM)
|
||||||
: BaseT(TM), TLI(TM->getSubtargetImpl()->getTargetLowering()) {}
|
: BaseT(TM), TM(TM), TLI(TM->getSubtargetImpl()->getTargetLowering()) {}
|
||||||
|
|
||||||
// Provide value semantics. MSVC requires that we spell all of these out.
|
// Provide value semantics. MSVC requires that we spell all of these out.
|
||||||
NVPTXTTIImpl(const NVPTXTTIImpl &Arg)
|
NVPTXTTIImpl(const NVPTXTTIImpl &Arg)
|
||||||
: BaseT(static_cast<const BaseT &>(Arg)), TLI(Arg.TLI) {}
|
: BaseT(static_cast<const BaseT &>(Arg)), TM(Arg.TM), TLI(Arg.TLI) {}
|
||||||
NVPTXTTIImpl(NVPTXTTIImpl &&Arg)
|
NVPTXTTIImpl(NVPTXTTIImpl &&Arg)
|
||||||
: BaseT(std::move(static_cast<BaseT &>(Arg))), TLI(std::move(Arg.TLI)) {}
|
: BaseT(std::move(static_cast<BaseT &>(Arg))), TM(std::move(Arg.TM)), TLI(std::move(Arg.TLI)) {}
|
||||||
NVPTXTTIImpl &operator=(const NVPTXTTIImpl &RHS) {
|
NVPTXTTIImpl &operator=(const NVPTXTTIImpl &RHS) {
|
||||||
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
||||||
|
TM = RHS.TM;
|
||||||
TLI = RHS.TLI;
|
TLI = RHS.TLI;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
NVPTXTTIImpl &operator=(NVPTXTTIImpl &&RHS) {
|
NVPTXTTIImpl &operator=(NVPTXTTIImpl &&RHS) {
|
||||||
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
||||||
|
TM = std::move(RHS.TM);
|
||||||
TLI = std::move(RHS.TLI);
|
TLI = std::move(RHS.TLI);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,28 +28,37 @@ namespace llvm {
|
||||||
class PPCTTIImpl : public BasicTTIImplBase<PPCTTIImpl> {
|
class PPCTTIImpl : public BasicTTIImplBase<PPCTTIImpl> {
|
||||||
typedef BasicTTIImplBase<PPCTTIImpl> BaseT;
|
typedef BasicTTIImplBase<PPCTTIImpl> BaseT;
|
||||||
typedef TargetTransformInfo TTI;
|
typedef TargetTransformInfo TTI;
|
||||||
|
friend BaseT;
|
||||||
|
|
||||||
|
const PPCTargetMachine *TM;
|
||||||
const PPCSubtarget *ST;
|
const PPCSubtarget *ST;
|
||||||
const PPCTargetLowering *TLI;
|
const PPCTargetLowering *TLI;
|
||||||
|
|
||||||
|
const PPCTargetMachine *getTM() const { return TM; }
|
||||||
|
const PPCTargetLowering *getTLI() const { return TLI; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PPCTTIImpl(const PPCTargetMachine *TM, Function &F)
|
explicit PPCTTIImpl(const PPCTargetMachine *TM, Function &F)
|
||||||
: BaseT(TM), ST(TM->getSubtargetImpl(F)), TLI(ST->getTargetLowering()) {}
|
: BaseT(TM), TM(TM), ST(TM->getSubtargetImpl(F)),
|
||||||
|
TLI(ST->getTargetLowering()) {}
|
||||||
|
|
||||||
// Provide value semantics. MSVC requires that we spell all of these out.
|
// Provide value semantics. MSVC requires that we spell all of these out.
|
||||||
PPCTTIImpl(const PPCTTIImpl &Arg)
|
PPCTTIImpl(const PPCTTIImpl &Arg)
|
||||||
: BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {}
|
: BaseT(static_cast<const BaseT &>(Arg)), TM(Arg.TM), ST(Arg.ST),
|
||||||
|
TLI(Arg.TLI) {}
|
||||||
PPCTTIImpl(PPCTTIImpl &&Arg)
|
PPCTTIImpl(PPCTTIImpl &&Arg)
|
||||||
: BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)),
|
: BaseT(std::move(static_cast<BaseT &>(Arg))), TM(std::move(Arg.TM)),
|
||||||
TLI(std::move(Arg.TLI)) {}
|
ST(std::move(Arg.ST)), TLI(std::move(Arg.TLI)) {}
|
||||||
PPCTTIImpl &operator=(const PPCTTIImpl &RHS) {
|
PPCTTIImpl &operator=(const PPCTTIImpl &RHS) {
|
||||||
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
||||||
|
TM = RHS.TM;
|
||||||
ST = RHS.ST;
|
ST = RHS.ST;
|
||||||
TLI = RHS.TLI;
|
TLI = RHS.TLI;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
PPCTTIImpl &operator=(PPCTTIImpl &&RHS) {
|
PPCTTIImpl &operator=(PPCTTIImpl &&RHS) {
|
||||||
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
||||||
|
TM = std::move(RHS.TM);
|
||||||
ST = std::move(RHS.ST);
|
ST = std::move(RHS.ST);
|
||||||
TLI = std::move(RHS.TLI);
|
TLI = std::move(RHS.TLI);
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -28,26 +28,39 @@ namespace llvm {
|
||||||
class AMDGPUTTIImpl : public BasicTTIImplBase<AMDGPUTTIImpl> {
|
class AMDGPUTTIImpl : public BasicTTIImplBase<AMDGPUTTIImpl> {
|
||||||
typedef BasicTTIImplBase<AMDGPUTTIImpl> BaseT;
|
typedef BasicTTIImplBase<AMDGPUTTIImpl> BaseT;
|
||||||
typedef TargetTransformInfo TTI;
|
typedef TargetTransformInfo TTI;
|
||||||
|
friend BaseT;
|
||||||
|
|
||||||
|
const AMDGPUTargetMachine *TM;
|
||||||
const AMDGPUSubtarget *ST;
|
const AMDGPUSubtarget *ST;
|
||||||
|
const AMDGPUTargetLowering *TLI;
|
||||||
|
|
||||||
|
const AMDGPUTargetMachine *getTM() const { return TM; }
|
||||||
|
const AMDGPUTargetLowering *getTLI() const { return TLI; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AMDGPUTTIImpl(const AMDGPUTargetMachine *TM)
|
explicit AMDGPUTTIImpl(const AMDGPUTargetMachine *TM)
|
||||||
: BaseT(TM), ST(TM->getSubtargetImpl()) {}
|
: BaseT(TM), TM(TM), ST(TM->getSubtargetImpl()),
|
||||||
|
TLI(ST->getTargetLowering()) {}
|
||||||
|
|
||||||
// Provide value semantics. MSVC requires that we spell all of these out.
|
// Provide value semantics. MSVC requires that we spell all of these out.
|
||||||
AMDGPUTTIImpl(const AMDGPUTTIImpl &Arg)
|
AMDGPUTTIImpl(const AMDGPUTTIImpl &Arg)
|
||||||
: BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST) {}
|
: BaseT(static_cast<const BaseT &>(Arg)), TM(Arg.TM), ST(Arg.ST),
|
||||||
|
TLI(Arg.TLI) {}
|
||||||
AMDGPUTTIImpl(AMDGPUTTIImpl &&Arg)
|
AMDGPUTTIImpl(AMDGPUTTIImpl &&Arg)
|
||||||
: BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)) {}
|
: BaseT(std::move(static_cast<BaseT &>(Arg))), TM(std::move(Arg.TM)),
|
||||||
|
ST(std::move(Arg.ST)), TLI(std::move(Arg.TLI)) {}
|
||||||
AMDGPUTTIImpl &operator=(const AMDGPUTTIImpl &RHS) {
|
AMDGPUTTIImpl &operator=(const AMDGPUTTIImpl &RHS) {
|
||||||
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
||||||
|
TM = RHS.TM;
|
||||||
ST = RHS.ST;
|
ST = RHS.ST;
|
||||||
|
TLI = RHS.TLI;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
AMDGPUTTIImpl &operator=(AMDGPUTTIImpl &&RHS) {
|
AMDGPUTTIImpl &operator=(AMDGPUTTIImpl &&RHS) {
|
||||||
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
||||||
|
TM = std::move(RHS.TM);
|
||||||
ST = std::move(RHS.ST);
|
ST = std::move(RHS.ST);
|
||||||
|
TLI = std::move(RHS.TLI);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,30 +28,39 @@ namespace llvm {
|
||||||
class X86TTIImpl : public BasicTTIImplBase<X86TTIImpl> {
|
class X86TTIImpl : public BasicTTIImplBase<X86TTIImpl> {
|
||||||
typedef BasicTTIImplBase<X86TTIImpl> BaseT;
|
typedef BasicTTIImplBase<X86TTIImpl> BaseT;
|
||||||
typedef TargetTransformInfo TTI;
|
typedef TargetTransformInfo TTI;
|
||||||
|
friend BaseT;
|
||||||
|
|
||||||
|
const X86TargetMachine *TM;
|
||||||
const X86Subtarget *ST;
|
const X86Subtarget *ST;
|
||||||
const X86TargetLowering *TLI;
|
const X86TargetLowering *TLI;
|
||||||
|
|
||||||
unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract);
|
unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract);
|
||||||
|
|
||||||
|
const X86TargetMachine *getTM() const { return TM; }
|
||||||
|
const X86TargetLowering *getTLI() const { return TLI; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit X86TTIImpl(const X86TargetMachine *TM, Function &F)
|
explicit X86TTIImpl(const X86TargetMachine *TM, Function &F)
|
||||||
: BaseT(TM), ST(TM->getSubtargetImpl(F)), TLI(ST->getTargetLowering()) {}
|
: BaseT(TM), TM(TM), ST(TM->getSubtargetImpl(F)),
|
||||||
|
TLI(ST->getTargetLowering()) {}
|
||||||
|
|
||||||
// Provide value semantics. MSVC requires that we spell all of these out.
|
// Provide value semantics. MSVC requires that we spell all of these out.
|
||||||
X86TTIImpl(const X86TTIImpl &Arg)
|
X86TTIImpl(const X86TTIImpl &Arg)
|
||||||
: BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {}
|
: BaseT(static_cast<const BaseT &>(Arg)), TM(Arg.TM), ST(Arg.ST),
|
||||||
|
TLI(Arg.TLI) {}
|
||||||
X86TTIImpl(X86TTIImpl &&Arg)
|
X86TTIImpl(X86TTIImpl &&Arg)
|
||||||
: BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)),
|
: BaseT(std::move(static_cast<BaseT &>(Arg))), TM(std::move(Arg.TM)),
|
||||||
TLI(std::move(Arg.TLI)) {}
|
ST(std::move(Arg.ST)), TLI(std::move(Arg.TLI)) {}
|
||||||
X86TTIImpl &operator=(const X86TTIImpl &RHS) {
|
X86TTIImpl &operator=(const X86TTIImpl &RHS) {
|
||||||
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
||||||
|
TM = RHS.TM;
|
||||||
ST = RHS.ST;
|
ST = RHS.ST;
|
||||||
TLI = RHS.TLI;
|
TLI = RHS.TLI;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
X86TTIImpl &operator=(X86TTIImpl &&RHS) {
|
X86TTIImpl &operator=(X86TTIImpl &&RHS) {
|
||||||
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
||||||
|
TM = std::move(RHS.TM);
|
||||||
ST = std::move(RHS.ST);
|
ST = std::move(RHS.ST);
|
||||||
TLI = std::move(RHS.TLI);
|
TLI = std::move(RHS.TLI);
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -28,21 +28,34 @@ namespace llvm {
|
||||||
class XCoreTTIImpl : public BasicTTIImplBase<XCoreTTIImpl> {
|
class XCoreTTIImpl : public BasicTTIImplBase<XCoreTTIImpl> {
|
||||||
typedef BasicTTIImplBase<XCoreTTIImpl> BaseT;
|
typedef BasicTTIImplBase<XCoreTTIImpl> BaseT;
|
||||||
typedef TargetTransformInfo TTI;
|
typedef TargetTransformInfo TTI;
|
||||||
|
friend BaseT;
|
||||||
|
|
||||||
|
const XCoreTargetMachine *TM;
|
||||||
|
const XCoreTargetLowering *TLI;
|
||||||
|
|
||||||
|
const XCoreTargetMachine *getTM() const { return TM; }
|
||||||
|
const XCoreTargetLowering *getTLI() const { return TLI; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit XCoreTTIImpl(const XCoreTargetMachine *TM) : BaseT(TM) {}
|
explicit XCoreTTIImpl(const XCoreTargetMachine *TM)
|
||||||
|
: BaseT(TM), TM(TM), TLI(TM->getSubtargetImpl()->getTargetLowering()) {}
|
||||||
|
|
||||||
// Provide value semantics. MSVC requires that we spell all of these out.
|
// Provide value semantics. MSVC requires that we spell all of these out.
|
||||||
XCoreTTIImpl(const XCoreTTIImpl &Arg)
|
XCoreTTIImpl(const XCoreTTIImpl &Arg)
|
||||||
: BaseT(static_cast<const BaseT &>(Arg)) {}
|
: BaseT(static_cast<const BaseT &>(Arg)), TM(Arg.TM), TLI(Arg.TLI) {}
|
||||||
XCoreTTIImpl(XCoreTTIImpl &&Arg)
|
XCoreTTIImpl(XCoreTTIImpl &&Arg)
|
||||||
: BaseT(std::move(static_cast<BaseT &>(Arg))) {}
|
: BaseT(std::move(static_cast<BaseT &>(Arg))), TM(std::move(Arg.TM)),
|
||||||
|
TLI(std::move(Arg.TLI)) {}
|
||||||
XCoreTTIImpl &operator=(const XCoreTTIImpl &RHS) {
|
XCoreTTIImpl &operator=(const XCoreTTIImpl &RHS) {
|
||||||
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
BaseT::operator=(static_cast<const BaseT &>(RHS));
|
||||||
|
TM = RHS.TM;
|
||||||
|
TLI = RHS.TLI;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
XCoreTTIImpl &operator=(XCoreTTIImpl &&RHS) {
|
XCoreTTIImpl &operator=(XCoreTTIImpl &&RHS) {
|
||||||
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
|
||||||
|
TM = std::move(RHS.TM);
|
||||||
|
TLI = std::move(RHS.TLI);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue