LLVM  14.0.0git
AVR.h
Go to the documentation of this file.
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.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_AVR_H
15 #define LLVM_AVR_H
16 
19 
20 namespace llvm {
21 
22 class AVRTargetMachine;
23 class FunctionPass;
24 
26 FunctionPass *createAVRISelDag(AVRTargetMachine &TM,
27  CodeGenOpt::Level OptLevel);
28 FunctionPass *createAVRExpandPseudoPass();
29 FunctionPass *createAVRFrameAnalyzerPass();
30 FunctionPass *createAVRRelaxMemPass();
31 FunctionPass *createAVRDynAllocaSRPass();
32 FunctionPass *createAVRBranchSelectionPass();
33 
34 void initializeAVRShiftExpandPass(PassRegistry &);
35 void initializeAVRExpandPseudoPass(PassRegistry &);
36 void initializeAVRRelaxMemPass(PassRegistry &);
37 
38 /// Contains the AVR backend.
39 namespace AVR {
40 
41 /// An integer that identifies all of the supported AVR address spaces.
43 
44 /// Checks if a given type is a pointer to program memory.
45 template <typename T> bool isProgramMemoryAddress(T *V) {
46  return cast<PointerType>(V->getType())->getAddressSpace() == ProgramMemory;
47 }
48 
49 inline bool isProgramMemoryAccess(MemSDNode const *N) {
50  auto V = N->getMemOperand()->getValue();
51 
52  return (V != nullptr) ? isProgramMemoryAddress(V) : false;
53 }
54 
55 } // end of namespace AVR
56 
57 } // end namespace llvm
58 
59 #endif // LLVM_AVR_H
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
Pass
print lazy value Lazy Value Info Printer Pass
Definition: LazyValueInfo.cpp:1965
llvm::createAVRBranchSelectionPass
FunctionPass * createAVRBranchSelectionPass()
llvm::AVR::ProgramMemory
@ ProgramMemory
Definition: AVR.h:42
llvm::MemSDNode
This is an abstract virtual class for memory operations.
Definition: SelectionDAGNodes.h:1254
llvm::AVR::DataMemory
@ DataMemory
Definition: AVR.h:42
TargetMachine.h
SelectionDAGNodes.h
llvm::initializeAVRExpandPseudoPass
void initializeAVRExpandPseudoPass(PassRegistry &)
llvm::createAVRDynAllocaSRPass
FunctionPass * createAVRDynAllocaSRPass()
createAVRDynAllocaSRPass - returns an instance of the dynalloca stack pointer save/restore pass.
Definition: AVRFrameLowering.cpp:535
llvm::AVR::isProgramMemoryAddress
bool isProgramMemoryAddress(T *V)
Checks if a given type is a pointer to program memory.
Definition: AVR.h:45
llvm::initializeAVRRelaxMemPass
void initializeAVRRelaxMemPass(PassRegistry &)
llvm::initializeAVRShiftExpandPass
void initializeAVRShiftExpandPass(PassRegistry &)
llvm::createAVRISelDag
FunctionPass * createAVRISelDag(AVRTargetMachine &TM, CodeGenOpt::Level OptLevel)
Definition: AVRISelDAGToDAG.cpp:554
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::AVR::AddressSpace
AddressSpace
An integer that identifies all of the supported AVR address spaces.
Definition: AVR.h:42
llvm::createAVRFrameAnalyzerPass
FunctionPass * createAVRFrameAnalyzerPass()
Creates instance of the frame analyzer pass.
Definition: AVRFrameLowering.cpp:483
N
#define N
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::createAVRShiftExpandPass
Pass * createAVRShiftExpandPass()
llvm::createAVRExpandPseudoPass
FunctionPass * createAVRExpandPseudoPass()
llvm::createAVRRelaxMemPass
FunctionPass * createAVRRelaxMemPass()
llvm::AVR::isProgramMemoryAccess
bool isProgramMemoryAccess(MemSDNode const *N)
Definition: AVR.h:49