1139f7f9bSDimitry Andric //===- BasicTargetTransformInfo.cpp - Basic target-independent TTI impl ---===// 2139f7f9bSDimitry Andric // 3139f7f9bSDimitry Andric // The LLVM Compiler Infrastructure 4139f7f9bSDimitry Andric // 5139f7f9bSDimitry Andric // This file is distributed under the University of Illinois Open Source 6139f7f9bSDimitry Andric // License. See LICENSE.TXT for details. 7139f7f9bSDimitry Andric // 8139f7f9bSDimitry Andric //===----------------------------------------------------------------------===// 9139f7f9bSDimitry Andric /// \file 10139f7f9bSDimitry Andric /// This file provides the implementation of a basic TargetTransformInfo pass 11139f7f9bSDimitry Andric /// predicated on the target abstractions present in the target independent 12139f7f9bSDimitry Andric /// code generator. It uses these (primarily TargetLowering) to model as much 13139f7f9bSDimitry Andric /// of the TTI query interface as possible. It is included by most targets so 14139f7f9bSDimitry Andric /// that they can specialize only a small subset of the query space. 15139f7f9bSDimitry Andric /// 16139f7f9bSDimitry Andric //===----------------------------------------------------------------------===// 17139f7f9bSDimitry Andric 18db17bf38SDimitry Andric #include "llvm/CodeGen/BasicTTIImpl.h" 19*2cab237bSDimitry Andric #include "llvm/CodeGen/TargetSubtargetInfo.h" 20*2cab237bSDimitry Andric #include "llvm/IR/Function.h" 2191bc56edSDimitry Andric #include "llvm/Support/CommandLine.h" 22*2cab237bSDimitry Andric #include "llvm/Target/TargetMachine.h" 23*2cab237bSDimitry Andric 24139f7f9bSDimitry Andric using namespace llvm; 25139f7f9bSDimitry Andric 26ff0cc061SDimitry Andric // This flag is used by the template base class for BasicTTIImpl, and here to 27ff0cc061SDimitry Andric // provide a definition. 28ff0cc061SDimitry Andric cl::opt<unsigned> 29ff0cc061SDimitry Andric llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0), 30ff0cc061SDimitry Andric cl::desc("Threshold for partial unrolling"), 31ff0cc061SDimitry Andric cl::Hidden); 32139f7f9bSDimitry Andric BasicTTIImpl(const TargetMachine * TM,const Function & F)337d523365SDimitry AndricBasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F) 34875ed548SDimitry Andric : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)), 35875ed548SDimitry Andric TLI(ST->getTargetLowering()) {} 36