10b57cec5SDimitry Andric //===- ARCTargetTransformInfo.h - ARC specific TTI --------------*- C++ -*-===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric // \file 90b57cec5SDimitry Andric // This file contains a TargetTransformInfo::Concept conforming object specific 100b57cec5SDimitry Andric // to the ARC target machine. It uses the target's detailed information to 110b57cec5SDimitry Andric // provide more precise answers to certain TTI queries, while letting the 120b57cec5SDimitry Andric // target independent and default TTI implementations handle the rest. 130b57cec5SDimitry Andric // 140b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 150b57cec5SDimitry Andric 160b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H 170b57cec5SDimitry Andric #define LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H 180b57cec5SDimitry Andric 190b57cec5SDimitry Andric #include "ARC.h" 200b57cec5SDimitry Andric #include "llvm/Analysis/TargetTransformInfo.h" 210b57cec5SDimitry Andric #include "llvm/CodeGen/BasicTTIImpl.h" 220b57cec5SDimitry Andric 230b57cec5SDimitry Andric namespace llvm { 240b57cec5SDimitry Andric 250b57cec5SDimitry Andric class ARCSubtarget; 260b57cec5SDimitry Andric class ARCTargetLowering; 270b57cec5SDimitry Andric class ARCTargetMachine; 280b57cec5SDimitry Andric 290b57cec5SDimitry Andric class ARCTTIImpl : public BasicTTIImplBase<ARCTTIImpl> { 300b57cec5SDimitry Andric using BaseT = BasicTTIImplBase<ARCTTIImpl>; 310b57cec5SDimitry Andric friend BaseT; 320b57cec5SDimitry Andric 330b57cec5SDimitry Andric const ARCSubtarget *ST; 340b57cec5SDimitry Andric const ARCTargetLowering *TLI; 350b57cec5SDimitry Andric getST()360b57cec5SDimitry Andric const ARCSubtarget *getST() const { return ST; } getTLI()370b57cec5SDimitry Andric const ARCTargetLowering *getTLI() const { return TLI; } 380b57cec5SDimitry Andric 390b57cec5SDimitry Andric public: ARCTTIImpl(const ARCTargetMachine * TM,const Function & F)400b57cec5SDimitry Andric explicit ARCTTIImpl(const ARCTargetMachine *TM, const Function &F) 41*0fca6ea1SDimitry Andric : BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl()), 420b57cec5SDimitry Andric TLI(ST->getTargetLowering()) {} 430b57cec5SDimitry Andric 440b57cec5SDimitry Andric // Provide value semantics. MSVC requires that we spell all of these out. ARCTTIImpl(const ARCTTIImpl & Arg)450b57cec5SDimitry Andric ARCTTIImpl(const ARCTTIImpl &Arg) 460b57cec5SDimitry Andric : BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {} ARCTTIImpl(ARCTTIImpl && Arg)470b57cec5SDimitry Andric ARCTTIImpl(ARCTTIImpl &&Arg) 480b57cec5SDimitry Andric : BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)), 490b57cec5SDimitry Andric TLI(std::move(Arg.TLI)) {} 500b57cec5SDimitry Andric }; 510b57cec5SDimitry Andric 520b57cec5SDimitry Andric } // end namespace llvm 530b57cec5SDimitry Andric 540b57cec5SDimitry Andric #endif // LLVM_LIB_TARGET_ARC_ARCTARGETTRANSFORMINFO_H 55