blob: 82f5c482408a82971db2e69963363842916533f5 [file] [log] [blame]
Chandler Carruth664e3542013-01-07 01:37:14 +00001//===- 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
Chandler Carruth705b1852015-01-31 03:43:40 +000018#include "llvm/CodeGen/BasicTTIImpl.h"
Hal Finkel6532c202014-05-08 09:14:44 +000019#include "llvm/Analysis/LoopInfo.h"
Chandler Carruthd3e73552013-01-07 03:08:10 +000020#include "llvm/Analysis/TargetTransformInfo.h"
Chandler Carruth705b1852015-01-31 03:43:40 +000021#include "llvm/Analysis/TargetTransformInfoImpl.h"
Chandler Carruth71f308a2015-02-13 09:09:03 +000022#include "llvm/CodeGen/Passes.h"
Hal Finkel6532c202014-05-08 09:14:44 +000023#include "llvm/Support/CommandLine.h"
Chandler Carruth664e3542013-01-07 01:37:14 +000024#include <utility>
Chandler Carruth664e3542013-01-07 01:37:14 +000025using namespace llvm;
26
Chandler Carruth93dcdc42015-01-31 11:17:59 +000027#define DEBUG_TYPE "basictti"
28
29// This flag is used by the template base class for BasicTTIImpl, and here to
30// provide a definition.
Chandler Carruth705b1852015-01-31 03:43:40 +000031cl::opt<unsigned>
32 llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0),
33 cl::desc("Threshold for partial unrolling"),
34 cl::Hidden);
Hal Finkel6532c202014-05-08 09:14:44 +000035
Chandler Carruthc956ab662015-02-01 14:22:17 +000036BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, Function &F)
37 : BaseT(TM), ST(TM->getSubtargetImpl(F)), TLI(ST->getTargetLowering()) {}