1 //===- ARCTargetTransformInfo.h - ARC specific TTI --------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains a TargetTransformInfo::Concept conforming object specific
11 // to the ARC target machine. It uses the target's detailed information to
12 // provide more precise answers to certain TTI queries, while letting the
13 // target independent and default TTI implementations handle the rest.
15 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H
18 #define LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H
21 #include "llvm/Analysis/TargetTransformInfo.h"
22 #include "llvm/CodeGen/BasicTTIImpl.h"
27 class ARCTargetLowering;
28 class ARCTargetMachine;
30 class ARCTTIImpl : public BasicTTIImplBase<ARCTTIImpl> {
31 using BaseT = BasicTTIImplBase<ARCTTIImpl>;
34 const ARCSubtarget *ST;
35 const ARCTargetLowering *TLI;
37 const ARCSubtarget *getST() const { return ST; }
38 const ARCTargetLowering *getTLI() const { return TLI; }
41 explicit ARCTTIImpl(const ARCTargetMachine *TM, const Function &F)
42 : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl()),
43 TLI(ST->getTargetLowering()) {}
45 // Provide value semantics. MSVC requires that we spell all of these out.
46 ARCTTIImpl(const ARCTTIImpl &Arg)
47 : BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {}
48 ARCTTIImpl(ARCTTIImpl &&Arg)
49 : BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)),
50 TLI(std::move(Arg.TLI)) {}
53 } // end namespace llvm
55 #endif // LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H