LLVM 24.0.0git
BasicTargetTransformInfo.cpp
Go to the documentation of this file.
1//===- BasicTargetTransformInfo.cpp - Basic target-independent TTI impl ---===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8/// \file
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.
14///
15//===----------------------------------------------------------------------===//
16
19#include "llvm/IR/Function.h"
22
23using namespace llvm;
24
26 PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0),
27 cl::desc("Threshold for partial unrolling"),
29
30std::optional<unsigned> llvm::getPartialUnrollingThreshold() {
31 if (PartialUnrollingThreshold.getNumOccurrences())
33 return std::nullopt;
34}
35
37 : BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),
38 TLI(ST->getTargetLowering()) {}
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
static cl::opt< unsigned > PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0), cl::desc("Threshold for partial unrolling"), cl::Hidden)
#define F(x, y, z)
Definition MD5.cpp:54
LLVM_ABI BasicTTIImpl(const TargetMachine *TM, const Function &F)
Primary interface to the complete machine description for the target machine.
virtual const DataLayout & getDataLayout() const
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI std::optional< unsigned > getPartialUnrollingThreshold()
Returns -partial-unrolling-threshold if specified.