LLVM  8.0.1
AVR.h
Go to the documentation of this file.
1 //===-- AVR.h - Top-level interface for AVR representation ------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the entry points for global functions defined in the LLVM
11 // AVR back-end.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_AVR_H
16 #define LLVM_AVR_H
17 
20 
21 namespace llvm {
22 
23 class AVRTargetMachine;
24 class FunctionPass;
25 
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 initializeAVRExpandPseudoPass(PassRegistry&);
35 void initializeAVRRelaxMemPass(PassRegistry&);
36 
37 /// Contains the AVR backend.
38 namespace AVR {
39 
40 /// An integer that identifies all of the supported AVR address spaces.
42 
43 /// Checks if a given type is a pointer to program memory.
44 template <typename T> bool isProgramMemoryAddress(T *V) {
45  return cast<PointerType>(V->getType())->getAddressSpace() == ProgramMemory;
46 }
47 
48 inline bool isProgramMemoryAccess(MemSDNode const *N) {
49  auto V = N->getMemOperand()->getValue();
50 
51  return (V != nullptr) ? isProgramMemoryAddress(V) : false;
52 }
53 
54 } // end of namespace AVR
55 
56 } // end namespace llvm
57 
58 #endif // LLVM_AVR_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
bool isProgramMemoryAccess(MemSDNode const *N)
Definition: AVR.h:48
FunctionPass * createAVRRelaxMemPass()
bool isProgramMemoryAddress(T *V)
Checks if a given type is a pointer to program memory.
Definition: AVR.h:44
void initializeAVRRelaxMemPass(PassRegistry &)
const Value * getValue() const
Return the base address of the memory access.
FunctionPass * createAVRISelDag(AVRTargetMachine &TM, CodeGenOpt::Level OptLevel)
FunctionPass * createAVRBranchSelectionPass()
This is an abstract virtual class for memory operations.
FunctionPass * createAVRExpandPseudoPass()
#define N
FunctionPass * createAVRFrameAnalyzerPass()
Creates instance of the frame analyzer pass.
AddressSpace
An integer that identifies all of the supported AVR address spaces.
Definition: AVR.h:41
void initializeAVRExpandPseudoPass(PassRegistry &)
FunctionPass * createAVRDynAllocaSRPass()
createAVRDynAllocaSRPass - returns an instance of the dynalloca stack pointer save/restore pass...