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 186532c20fSHal Finkel #include "llvm/Analysis/LoopInfo.h" 19d3e73556SChandler Carruth #include "llvm/Analysis/TargetTransformInfo.h" 20705b185fSChandler Carruth #include "llvm/Analysis/TargetTransformInfoImpl.h" 21*6bda14b3SChandler Carruth #include "llvm/CodeGen/BasicTTIImpl.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 // This flag is used by the template base class for BasicTTIImpl, and here to 2893dcdc47SChandler Carruth // provide a definition. 29705b185fSChandler Carruth cl::opt<unsigned> 30705b185fSChandler Carruth llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0), 31705b185fSChandler Carruth cl::desc("Threshold for partial unrolling"), 32705b185fSChandler Carruth cl::Hidden); 336532c20fSHal Finkel 34a4e5d3cfSEric Christopher BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F) 355010ebf1SMehdi Amini : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)), 365010ebf1SMehdi Amini TLI(ST->getTargetLowering()) {} 37