1664e354dSChandler Carruth //===- BasicTargetTransformInfo.cpp - Basic target-independent TTI impl ---===//
2664e354dSChandler Carruth //
3664e354dSChandler Carruth //                     The LLVM Compiler Infrastructure
4664e354dSChandler Carruth //
5664e354dSChandler Carruth // This file is distributed under the University of Illinois Open Source
6664e354dSChandler Carruth // License. See LICENSE.TXT for details.
7664e354dSChandler Carruth //
8664e354dSChandler Carruth //===----------------------------------------------------------------------===//
9664e354dSChandler Carruth /// \file
10664e354dSChandler Carruth /// This file provides the implementation of a basic TargetTransformInfo pass
11664e354dSChandler Carruth /// predicated on the target abstractions present in the target independent
12664e354dSChandler Carruth /// code generator. It uses these (primarily TargetLowering) to model as much
13664e354dSChandler Carruth /// of the TTI query interface as possible. It is included by most targets so
14664e354dSChandler Carruth /// that they can specialize only a small subset of the query space.
15664e354dSChandler Carruth ///
16664e354dSChandler Carruth //===----------------------------------------------------------------------===//
17664e354dSChandler Carruth 
18705b185fSChandler Carruth #include "llvm/CodeGen/BasicTTIImpl.h"
196532c20fSHal Finkel #include "llvm/Analysis/LoopInfo.h"
20d3e73556SChandler Carruth #include "llvm/Analysis/TargetTransformInfo.h"
21705b185fSChandler Carruth #include "llvm/Analysis/TargetTransformInfoImpl.h"
2271f308adSChandler Carruth #include "llvm/CodeGen/Passes.h"
236532c20fSHal Finkel #include "llvm/Support/CommandLine.h"
24664e354dSChandler Carruth #include <utility>
25664e354dSChandler Carruth using namespace llvm;
26664e354dSChandler Carruth 
2793dcdc47SChandler Carruth #define DEBUG_TYPE "basictti"
2893dcdc47SChandler Carruth 
2993dcdc47SChandler Carruth // This flag is used by the template base class for BasicTTIImpl, and here to
3093dcdc47SChandler Carruth // provide a definition.
31705b185fSChandler Carruth cl::opt<unsigned>
32705b185fSChandler Carruth     llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0),
33705b185fSChandler Carruth                                     cl::desc("Threshold for partial unrolling"),
34705b185fSChandler Carruth                                     cl::Hidden);
356532c20fSHal Finkel 
36*a4e5d3cfSEric Christopher BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F)
375010ebf1SMehdi Amini     : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
385010ebf1SMehdi Amini       TLI(ST->getTargetLowering()) {}
39