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 1891bc56edSDimitry Andric #include "llvm/Analysis/LoopInfo.h" 19139f7f9bSDimitry Andric #include "llvm/Analysis/TargetTransformInfo.h" 20ff0cc061SDimitry Andric #include "llvm/Analysis/TargetTransformInfoImpl.h" 21*db17bf38SDimitry Andric #include "llvm/CodeGen/BasicTTIImpl.h" 22ff0cc061SDimitry Andric #include "llvm/CodeGen/Passes.h" 2391bc56edSDimitry Andric #include "llvm/Support/CommandLine.h" 24139f7f9bSDimitry Andric #include <utility> 25139f7f9bSDimitry Andric using namespace llvm; 26139f7f9bSDimitry Andric 27ff0cc061SDimitry Andric // This flag is used by the template base class for BasicTTIImpl, and here to 28ff0cc061SDimitry Andric // provide a definition. 29ff0cc061SDimitry Andric cl::opt<unsigned> 30ff0cc061SDimitry Andric llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0), 31ff0cc061SDimitry Andric cl::desc("Threshold for partial unrolling"), 32ff0cc061SDimitry Andric cl::Hidden); 33139f7f9bSDimitry Andric 347d523365SDimitry Andric BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F) 35875ed548SDimitry Andric : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)), 36875ed548SDimitry Andric TLI(ST->getTargetLowering()) {} 37