1664e354dSChandler Carruth //===- BasicTargetTransformInfo.cpp - Basic target-independent TTI impl ---===//
2664e354dSChandler Carruth //
3*2946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*2946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
5*2946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6664e354dSChandler Carruth //
7664e354dSChandler Carruth //===----------------------------------------------------------------------===//
8664e354dSChandler Carruth /// \file
9664e354dSChandler Carruth /// This file provides the implementation of a basic TargetTransformInfo pass
10664e354dSChandler Carruth /// predicated on the target abstractions present in the target independent
11664e354dSChandler Carruth /// code generator. It uses these (primarily TargetLowering) to model as much
12664e354dSChandler Carruth /// of the TTI query interface as possible. It is included by most targets so
13664e354dSChandler Carruth /// that they can specialize only a small subset of the query space.
14664e354dSChandler Carruth ///
15664e354dSChandler Carruth //===----------------------------------------------------------------------===//
16664e354dSChandler Carruth 
176bda14b3SChandler Carruth #include "llvm/CodeGen/BasicTTIImpl.h"
18b3bde2eaSDavid Blaikie #include "llvm/CodeGen/TargetSubtargetInfo.h"
194f81cdd8SEugene Zelenko #include "llvm/IR/Function.h"
206532c20fSHal Finkel #include "llvm/Support/CommandLine.h"
214f81cdd8SEugene Zelenko #include "llvm/Target/TargetMachine.h"
224f81cdd8SEugene Zelenko 
23664e354dSChandler Carruth using namespace llvm;
24664e354dSChandler Carruth 
2593dcdc47SChandler Carruth // This flag is used by the template base class for BasicTTIImpl, and here to
2693dcdc47SChandler Carruth // provide a definition.
27705b185fSChandler Carruth cl::opt<unsigned>
28705b185fSChandler Carruth llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0),
29705b185fSChandler Carruth                                 cl::desc("Threshold for partial unrolling"),
30705b185fSChandler Carruth                                 cl::Hidden);
316532c20fSHal Finkel 
BasicTTIImpl(const TargetMachine * TM,const Function & F)32a4e5d3cfSEric Christopher BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F)
335010ebf1SMehdi Amini     : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
345010ebf1SMehdi Amini       TLI(ST->getTargetLowering()) {}
35