LLVM 22.0.0git
AVRTargetTransformInfo.h
Go to the documentation of this file.
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-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9/// This file defines a TargetTransformInfoImplBase conforming object specific
10/// to the AVR target machine. It uses the target's detailed information to
11/// provide more precise answers to certain TTI queries, while letting the
12/// target independent and default TTI implementations handle the rest.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_LIB_TARGET_AVR_AVRTARGETTRANSFORMINFO_H
17#define LLVM_LIB_TARGET_AVR_AVRTARGETTRANSFORMINFO_H
18
19#include "AVRSubtarget.h"
20#include "AVRTargetMachine.h"
23#include "llvm/IR/Function.h"
24#include <optional>
25
26namespace llvm {
27
28class AVRTTIImpl final : public BasicTTIImplBase<AVRTTIImpl> {
31
32 friend BaseT;
33
34 const AVRSubtarget *ST;
35 const AVRTargetLowering *TLI;
36
37 const AVRSubtarget *getST() const { return ST; }
38 const AVRTargetLowering *getTLI() const { return TLI; }
39
40public:
41 explicit AVRTTIImpl(const AVRTargetMachine *TM, const Function &F)
42 : BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),
43 TLI(ST->getTargetLowering()) {}
44
46 const TargetTransformInfo::LSRCost &C2) const override;
47};
48
49} // end namespace llvm
50
51#endif // LLVM_LIB_TARGET_AVR_AVRTARGETTRANSFORMINFO_H
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
#define F(x, y, z)
Definition: MD5.cpp:55
This pass exposes codegen information to IR-level passes.
A specific AVR target MCU.
Definition: AVRSubtarget.h:32
AVRTTIImpl(const AVRTargetMachine *TM, const Function &F)
bool isLSRCostLess(const TargetTransformInfo::LSRCost &C1, const TargetTransformInfo::LSRCost &C2) const override
Performs target lowering for the AVR.
A generic AVR implementation.
Base class which can be used to help build a TTI implementation.
Definition: BasicTTIImpl.h:82
virtual const DataLayout & getDataLayout() const
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18