xref: /src/contrib/llvm-project/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
14a16efa3SDimitry Andric //===- BasicTargetTransformInfo.cpp - Basic target-independent TTI impl ---===//
24a16efa3SDimitry Andric //
3e6d15924SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4e6d15924SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5e6d15924SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
64a16efa3SDimitry Andric //
74a16efa3SDimitry Andric //===----------------------------------------------------------------------===//
84a16efa3SDimitry Andric /// \file
94a16efa3SDimitry Andric /// This file provides the implementation of a basic TargetTransformInfo pass
104a16efa3SDimitry Andric /// predicated on the target abstractions present in the target independent
114a16efa3SDimitry Andric /// code generator. It uses these (primarily TargetLowering) to model as much
124a16efa3SDimitry Andric /// of the TTI query interface as possible. It is included by most targets so
134a16efa3SDimitry Andric /// that they can specialize only a small subset of the query space.
144a16efa3SDimitry Andric ///
154a16efa3SDimitry Andric //===----------------------------------------------------------------------===//
164a16efa3SDimitry Andric 
177ab83427SDimitry Andric #include "llvm/CodeGen/BasicTTIImpl.h"
18044eb2f6SDimitry Andric #include "llvm/CodeGen/TargetSubtargetInfo.h"
19044eb2f6SDimitry Andric #include "llvm/IR/Function.h"
205ca98fd9SDimitry Andric #include "llvm/Support/CommandLine.h"
21044eb2f6SDimitry Andric #include "llvm/Target/TargetMachine.h"
22044eb2f6SDimitry Andric 
234a16efa3SDimitry Andric using namespace llvm;
244a16efa3SDimitry Andric 
255a5ac124SDimitry Andric // This flag is used by the template base class for BasicTTIImpl, and here to
265a5ac124SDimitry Andric // provide a definition.
275a5ac124SDimitry Andric cl::opt<unsigned>
285a5ac124SDimitry Andric llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0),
295a5ac124SDimitry Andric                                 cl::desc("Threshold for partial unrolling"),
305a5ac124SDimitry Andric                                 cl::Hidden);
314a16efa3SDimitry Andric 
BasicTTIImpl(const TargetMachine * TM,const Function & F)32dd58ef01SDimitry Andric BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F)
33ac9a064cSDimitry Andric     : BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),
34ee8648bdSDimitry Andric       TLI(ST->getTargetLowering()) {}
35