1326938Sdim//===- ARCTargetTransformInfo.h - ARC specific TTI --------------*- C++ -*-===//
2326938Sdim//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6326938Sdim//
7326938Sdim//===----------------------------------------------------------------------===//
8326938Sdim// \file
9326938Sdim// This file contains a TargetTransformInfo::Concept conforming object specific
10326938Sdim// to the ARC target machine. It uses the target's detailed information to
11326938Sdim// provide more precise answers to certain TTI queries, while letting the
12326938Sdim// target independent and default TTI implementations handle the rest.
13326938Sdim//
14326938Sdim//===----------------------------------------------------------------------===//
15326938Sdim
16326938Sdim#ifndef LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H
17326938Sdim#define LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H
18326938Sdim
19326938Sdim#include "ARC.h"
20326938Sdim#include "llvm/Analysis/TargetTransformInfo.h"
21326938Sdim#include "llvm/CodeGen/BasicTTIImpl.h"
22326938Sdim
23326938Sdimnamespace llvm {
24326938Sdim
25326938Sdimclass ARCSubtarget;
26326938Sdimclass ARCTargetLowering;
27326938Sdimclass ARCTargetMachine;
28326938Sdim
29326938Sdimclass ARCTTIImpl : public BasicTTIImplBase<ARCTTIImpl> {
30326938Sdim  using BaseT = BasicTTIImplBase<ARCTTIImpl>;
31326938Sdim  friend BaseT;
32326938Sdim
33326938Sdim  const ARCSubtarget *ST;
34326938Sdim  const ARCTargetLowering *TLI;
35326938Sdim
36326938Sdim  const ARCSubtarget *getST() const { return ST; }
37326938Sdim  const ARCTargetLowering *getTLI() const { return TLI; }
38326938Sdim
39326938Sdimpublic:
40326938Sdim  explicit ARCTTIImpl(const ARCTargetMachine *TM, const Function &F)
41326938Sdim      : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl()),
42326938Sdim        TLI(ST->getTargetLowering()) {}
43326938Sdim
44326938Sdim  // Provide value semantics. MSVC requires that we spell all of these out.
45326938Sdim  ARCTTIImpl(const ARCTTIImpl &Arg)
46326938Sdim      : BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {}
47326938Sdim  ARCTTIImpl(ARCTTIImpl &&Arg)
48326938Sdim      : BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)),
49326938Sdim        TLI(std::move(Arg.TLI)) {}
50326938Sdim};
51326938Sdim
52326938Sdim} // end namespace llvm
53326938Sdim
54326938Sdim#endif // LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H
55