blob: d11f375b176e91a314917d3c478aca72ab717bff [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 Carruth6bda14b2017-06-06 11:49:48 +000018#include "llvm/CodeGen/BasicTTIImpl.h"
David Blaikieb3bde2e2017-11-17 01:07:10 +000019#include "llvm/CodeGen/TargetSubtargetInfo.h"
Eugene Zelenko4f81cdd2017-09-29 21:55:49 +000020#include "llvm/IR/Function.h"
Hal Finkel6532c202014-05-08 09:14:44 +000021#include "llvm/Support/CommandLine.h"
Eugene Zelenko4f81cdd2017-09-29 21:55:49 +000022#include "llvm/Target/TargetMachine.h"
Eugene Zelenko4f81cdd2017-09-29 21:55:49 +000023
Chandler Carruth664e3542013-01-07 01:37:14 +000024using namespace llvm;
25
Chandler Carruth93dcdc42015-01-31 11:17:59 +000026// This flag is used by the template base class for BasicTTIImpl, and here to
27// provide a definition.
Chandler Carruth705b1852015-01-31 03:43:40 +000028cl::opt<unsigned>
Eugene Zelenko4f81cdd2017-09-29 21:55:49 +000029llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0),
30 cl::desc("Threshold for partial unrolling"),
31 cl::Hidden);
Hal Finkel6532c202014-05-08 09:14:44 +000032
Eric Christophera4e5d3c2015-09-16 23:38:13 +000033BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F)
Mehdi Amini5010ebf2015-07-09 02:08:42 +000034 : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
35 TLI(ST->getTargetLowering()) {}