51 lines · c
1//===- AVRTargetTransformInfo.h - AVR specific TTI --------------*- C++ -*-===//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-exception6//7//===----------------------------------------------------------------------===//8/// \file9/// This file defines a TargetTransformInfoImplBase conforming object specific10/// to the AVR target machine. It uses the target's detailed information to11/// provide more precise answers to certain TTI queries, while letting the12/// target independent and default TTI implementations handle the rest.13///14//===----------------------------------------------------------------------===//15 16#ifndef LLVM_LIB_TARGET_AVR_AVRTARGETTRANSFORMINFO_H17#define LLVM_LIB_TARGET_AVR_AVRTARGETTRANSFORMINFO_H18 19#include "AVRSubtarget.h"20#include "AVRTargetMachine.h"21#include "llvm/Analysis/TargetTransformInfo.h"22#include "llvm/CodeGen/BasicTTIImpl.h"23#include "llvm/IR/Function.h"24 25namespace llvm {26 27class AVRTTIImpl final : public BasicTTIImplBase<AVRTTIImpl> {28 using BaseT = BasicTTIImplBase<AVRTTIImpl>;29 using TTI = TargetTransformInfo;30 31 friend BaseT;32 33 const AVRSubtarget *ST;34 const AVRTargetLowering *TLI;35 36 const AVRSubtarget *getST() const { return ST; }37 const AVRTargetLowering *getTLI() const { return TLI; }38 39public:40 explicit AVRTTIImpl(const AVRTargetMachine *TM, const Function &F)41 : BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),42 TLI(ST->getTargetLowering()) {}43 44 bool isLSRCostLess(const TargetTransformInfo::LSRCost &C1,45 const TargetTransformInfo::LSRCost &C2) const override;46};47 48} // end namespace llvm49 50#endif // LLVM_LIB_TARGET_AVR_AVRTARGETTRANSFORMINFO_H51