]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/ARC/ARCTargetTransformInfo.h
Merge libc++ trunk r338150 (just before the 7.0.0 branch point), and
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / ARC / ARCTargetTransformInfo.h
1 //===- ARCTargetTransformInfo.h - ARC specific TTI --------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 // \file
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.
14 //
15 //===----------------------------------------------------------------------===//
16
17 #ifndef LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H
18 #define LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H
19
20 #include "ARC.h"
21 #include "llvm/Analysis/TargetTransformInfo.h"
22 #include "llvm/CodeGen/BasicTTIImpl.h"
23
24 namespace llvm {
25
26 class ARCSubtarget;
27 class ARCTargetLowering;
28 class ARCTargetMachine;
29
30 class ARCTTIImpl : public BasicTTIImplBase<ARCTTIImpl> {
31   using BaseT = BasicTTIImplBase<ARCTTIImpl>;
32   friend BaseT;
33
34   const ARCSubtarget *ST;
35   const ARCTargetLowering *TLI;
36
37   const ARCSubtarget *getST() const { return ST; }
38   const ARCTargetLowering *getTLI() const { return TLI; }
39
40 public:
41   explicit ARCTTIImpl(const ARCTargetMachine *TM, const Function &F)
42       : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl()),
43         TLI(ST->getTargetLowering()) {}
44
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)) {}
51 };
52
53 } // end namespace llvm
54
55 #endif // LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H