Path: blob/main/contrib/llvm-project/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
35232 views
//===- BasicTargetTransformInfo.cpp - Basic target-independent TTI impl ---===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7/// \file8/// This file provides the implementation of a basic TargetTransformInfo pass9/// predicated on the target abstractions present in the target independent10/// code generator. It uses these (primarily TargetLowering) to model as much11/// of the TTI query interface as possible. It is included by most targets so12/// that they can specialize only a small subset of the query space.13///14//===----------------------------------------------------------------------===//1516#include "llvm/CodeGen/BasicTTIImpl.h"17#include "llvm/CodeGen/TargetSubtargetInfo.h"18#include "llvm/IR/Function.h"19#include "llvm/Support/CommandLine.h"20#include "llvm/Target/TargetMachine.h"2122using namespace llvm;2324// This flag is used by the template base class for BasicTTIImpl, and here to25// provide a definition.26cl::opt<unsigned>27llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0),28cl::desc("Threshold for partial unrolling"),29cl::Hidden);3031BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F)32: BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),33TLI(ST->getTargetLowering()) {}343536