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
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
45 const TargetTransformInfo::LSRCost &C2) const override;
46};
47
48} // end namespace llvm
49
50#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:54
This pass exposes codegen information to IR-level passes.
A specific AVR target MCU.
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.
BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)
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.