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