1 //===- BasicTargetTransformInfo.cpp - Basic target-independent TTI impl ---===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 /// This file provides the implementation of a basic TargetTransformInfo pass
10 /// predicated on the target abstractions present in the target independent
11 /// code generator. It uses these (primarily TargetLowering) to model as much
12 /// of the TTI query interface as possible. It is included by most targets so
13 /// that they can specialize only a small subset of the query space.
15 //===----------------------------------------------------------------------===//
17 #include "llvm/CodeGen/BasicTTIImpl.h"
18 #include "llvm/CodeGen/TargetSubtargetInfo.h"
19 #include "llvm/IR/Function.h"
20 #include "llvm/Support/CommandLine.h"
21 #include "llvm/Target/TargetMachine.h"
25 // This flag is used by the template base class for BasicTTIImpl, and here to
26 // provide a definition.
28 llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0),
29 cl::desc("Threshold for partial unrolling"),
32 BasicTTIImpl::BasicTTIImpl(const TargetMachine
*TM
, const Function
&F
)
33 : BaseT(TM
, F
.getParent()->getDataLayout()), ST(TM
->getSubtargetImpl(F
)),
34 TLI(ST
->getTargetLowering()) {}