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 186bda14b3SChandler Carruth #include "llvm/CodeGen/BasicTTIImpl.h" 19*b3bde2eaSDavid Blaikie #include "llvm/CodeGen/TargetSubtargetInfo.h" 204f81cdd8SEugene Zelenko #include "llvm/IR/Function.h" 216532c20fSHal Finkel #include "llvm/Support/CommandLine.h" 224f81cdd8SEugene Zelenko #include "llvm/Target/TargetMachine.h" 234f81cdd8SEugene Zelenko 24664e354dSChandler Carruth using namespace llvm; 25664e354dSChandler Carruth 2693dcdc47SChandler Carruth // This flag is used by the template base class for BasicTTIImpl, and here to 2793dcdc47SChandler Carruth // provide a definition. 28705b185fSChandler Carruth cl::opt<unsigned> 29705b185fSChandler Carruth llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0), 30705b185fSChandler Carruth cl::desc("Threshold for partial unrolling"), 31705b185fSChandler Carruth cl::Hidden); 326532c20fSHal Finkel 33a4e5d3cfSEric Christopher BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F) 345010ebf1SMehdi Amini : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)), 355010ebf1SMehdi Amini TLI(ST->getTargetLowering()) {} 36