1 //===- ARCTargetTransformInfo.h - ARC specific TTI --------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file contains a TargetTransformInfo::Concept conforming object specific
10 // to the ARC target machine. It uses the target's detailed information to
11 // provide more precise answers to certain TTI queries, while letting the
12 // target independent and default TTI implementations handle the rest.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H
17 #define LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H
20 #include "llvm/Analysis/TargetTransformInfo.h"
21 #include "llvm/CodeGen/BasicTTIImpl.h"
26 class ARCTargetLowering
;
27 class ARCTargetMachine
;
29 class ARCTTIImpl
: public BasicTTIImplBase
<ARCTTIImpl
> {
30 using BaseT
= BasicTTIImplBase
<ARCTTIImpl
>;
33 const ARCSubtarget
*ST
;
34 const ARCTargetLowering
*TLI
;
36 const ARCSubtarget
*getST() const { return ST
; }
37 const ARCTargetLowering
*getTLI() const { return TLI
; }
40 explicit ARCTTIImpl(const ARCTargetMachine
*TM
, const Function
&F
)
41 : BaseT(TM
, F
.getParent()->getDataLayout()), ST(TM
->getSubtargetImpl()),
42 TLI(ST
->getTargetLowering()) {}
44 // Provide value semantics. MSVC requires that we spell all of these out.
45 ARCTTIImpl(const ARCTTIImpl
&Arg
)
46 : BaseT(static_cast<const BaseT
&>(Arg
)), ST(Arg
.ST
), TLI(Arg
.TLI
) {}
47 ARCTTIImpl(ARCTTIImpl
&&Arg
)
48 : BaseT(std::move(static_cast<BaseT
&>(Arg
))), ST(std::move(Arg
.ST
)),
49 TLI(std::move(Arg
.TLI
)) {}
52 } // end namespace llvm
54 #endif // LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H