10b57cec5SDimitry Andric //===- BasicTargetTransformInfo.cpp - Basic target-independent TTI impl ---===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric /// \file 90b57cec5SDimitry Andric /// This file provides the implementation of a basic TargetTransformInfo pass 100b57cec5SDimitry Andric /// predicated on the target abstractions present in the target independent 110b57cec5SDimitry Andric /// code generator. It uses these (primarily TargetLowering) to model as much 120b57cec5SDimitry Andric /// of the TTI query interface as possible. It is included by most targets so 130b57cec5SDimitry Andric /// that they can specialize only a small subset of the query space. 140b57cec5SDimitry Andric /// 150b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 160b57cec5SDimitry Andric 170b57cec5SDimitry Andric #include "llvm/CodeGen/BasicTTIImpl.h" 180b57cec5SDimitry Andric #include "llvm/CodeGen/TargetSubtargetInfo.h" 190b57cec5SDimitry Andric #include "llvm/IR/Function.h" 200b57cec5SDimitry Andric #include "llvm/Support/CommandLine.h" 210b57cec5SDimitry Andric #include "llvm/Target/TargetMachine.h" 220b57cec5SDimitry Andric 230b57cec5SDimitry Andric using namespace llvm; 240b57cec5SDimitry Andric 250b57cec5SDimitry Andric // This flag is used by the template base class for BasicTTIImpl, and here to 260b57cec5SDimitry Andric // provide a definition. 270b57cec5SDimitry Andric cl::opt<unsigned> 280b57cec5SDimitry Andric llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0), 290b57cec5SDimitry Andric cl::desc("Threshold for partial unrolling"), 300b57cec5SDimitry Andric cl::Hidden); 310b57cec5SDimitry Andric 320b57cec5SDimitry Andric BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F) 33*0fca6ea1SDimitry Andric : BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)), 340b57cec5SDimitry Andric TLI(ST->getTargetLowering()) {} 35