1*9880d681SAndroid Build Coastguard Worker //===- BasicTargetTransformInfo.cpp - Basic target-independent TTI impl ---===// 2*9880d681SAndroid Build Coastguard Worker // 3*9880d681SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure 4*9880d681SAndroid Build Coastguard Worker // 5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source 6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details. 7*9880d681SAndroid Build Coastguard Worker // 8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 9*9880d681SAndroid Build Coastguard Worker /// \file 10*9880d681SAndroid Build Coastguard Worker /// This file provides the implementation of a basic TargetTransformInfo pass 11*9880d681SAndroid Build Coastguard Worker /// predicated on the target abstractions present in the target independent 12*9880d681SAndroid Build Coastguard Worker /// code generator. It uses these (primarily TargetLowering) to model as much 13*9880d681SAndroid Build Coastguard Worker /// of the TTI query interface as possible. It is included by most targets so 14*9880d681SAndroid Build Coastguard Worker /// that they can specialize only a small subset of the query space. 15*9880d681SAndroid Build Coastguard Worker /// 16*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 17*9880d681SAndroid Build Coastguard Worker 18*9880d681SAndroid Build Coastguard Worker #include "llvm/CodeGen/BasicTTIImpl.h" 19*9880d681SAndroid Build Coastguard Worker #include "llvm/Analysis/LoopInfo.h" 20*9880d681SAndroid Build Coastguard Worker #include "llvm/Analysis/TargetTransformInfo.h" 21*9880d681SAndroid Build Coastguard Worker #include "llvm/Analysis/TargetTransformInfoImpl.h" 22*9880d681SAndroid Build Coastguard Worker #include "llvm/CodeGen/Passes.h" 23*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/CommandLine.h" 24*9880d681SAndroid Build Coastguard Worker #include <utility> 25*9880d681SAndroid Build Coastguard Worker using namespace llvm; 26*9880d681SAndroid Build Coastguard Worker 27*9880d681SAndroid Build Coastguard Worker #define DEBUG_TYPE "basictti" 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Worker // This flag is used by the template base class for BasicTTIImpl, and here to 30*9880d681SAndroid Build Coastguard Worker // provide a definition. 31*9880d681SAndroid Build Coastguard Worker cl::opt<unsigned> 32*9880d681SAndroid Build Coastguard Worker llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0), 33*9880d681SAndroid Build Coastguard Worker cl::desc("Threshold for partial unrolling"), 34*9880d681SAndroid Build Coastguard Worker cl::Hidden); 35*9880d681SAndroid Build Coastguard Worker BasicTTIImpl(const TargetMachine * TM,const Function & F)36*9880d681SAndroid Build Coastguard WorkerBasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F) 37*9880d681SAndroid Build Coastguard Worker : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)), 38*9880d681SAndroid Build Coastguard Worker TLI(ST->getTargetLowering()) {} 39