[MIPS GlobalISel] Select MSA vector generic and builtin add
[llvm-complete.git] / lib / Target / AVR / AVR.h
blobf0746d73c95f477f92433a14d1e88bbb848e212c
1 //===-- AVR.h - Top-level interface for AVR representation ------*- 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 //
9 // This file contains the entry points for global functions defined in the LLVM
10 // AVR back-end.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_AVR_H
15 #define LLVM_AVR_H
17 #include "llvm/CodeGen/SelectionDAGNodes.h"
18 #include "llvm/Target/TargetMachine.h"
20 namespace llvm {
22 class AVRTargetMachine;
23 class FunctionPass;
25 FunctionPass *createAVRISelDag(AVRTargetMachine &TM,
26 CodeGenOpt::Level OptLevel);
27 FunctionPass *createAVRExpandPseudoPass();
28 FunctionPass *createAVRFrameAnalyzerPass();
29 FunctionPass *createAVRRelaxMemPass();
30 FunctionPass *createAVRDynAllocaSRPass();
31 FunctionPass *createAVRBranchSelectionPass();
33 void initializeAVRExpandPseudoPass(PassRegistry&);
34 void initializeAVRRelaxMemPass(PassRegistry&);
36 /// Contains the AVR backend.
37 namespace AVR {
39 /// An integer that identifies all of the supported AVR address spaces.
40 enum AddressSpace { DataMemory, ProgramMemory };
42 /// Checks if a given type is a pointer to program memory.
43 template <typename T> bool isProgramMemoryAddress(T *V) {
44 return cast<PointerType>(V->getType())->getAddressSpace() == ProgramMemory;
47 inline bool isProgramMemoryAccess(MemSDNode const *N) {
48 auto V = N->getMemOperand()->getValue();
50 return (V != nullptr) ? isProgramMemoryAddress(V) : false;
53 } // end of namespace AVR
55 } // end namespace llvm
57 #endif // LLVM_AVR_H