forked from Hoernchen/Epiphany
-
Notifications
You must be signed in to change notification settings - Fork 2
/
EpiphanyMachineFunction.h
129 lines (98 loc) · 3.67 KB
/
EpiphanyMachineFunction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
//=- EpiphanyMachineFuctionInfo.h - Epiphany machine function info -*- C++ -*-==//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares Epiphany-specific per-machine-function information.
//
//===----------------------------------------------------------------------===//
#ifndef EPIPHANYMACHINEFUNCTIONINFO_H
#define EPIPHANYMACHINEFUNCTIONINFO_H
#include "EpiphanyConfig.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/ValueMap.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetMachine.h"
#include <map>
#include <string>
#include <utility>
namespace llvm {
/// This class is derived from MachineFunctionInfo and contains private Epiphany
/// target-specific information for each MachineFunction.
class EpiphanyMachineFunctionInfo : public MachineFunctionInfo {
public:
EpiphanyMachineFunctionInfo(MachineFunction& MF)
: MF(MF),
VarArgsFrameIndex(0),
SRetReturnReg(0),
MaxCallFrameSize(0),
CallsEhReturn(false),
CallsEhDwarf(false),
HasFpuInst(false),
GlobalBaseReg(0),
EmitNOAT(false),
HasIalu2Inst(false)
{}
~EpiphanyMachineFunctionInfo();
bool getEmitNOAT() const { return EmitNOAT; }
void setEmitNOAT() { EmitNOAT = true; }
unsigned getSRetReturnReg() const { return SRetReturnReg; }
void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
bool hasByvalArg() const { return HasByvalArg; }
void setFormalArgInfo(unsigned Size, bool HasByval) {
IncomingArgSize = Size;
HasByvalArg = HasByval;
}
unsigned getIncomingArgSize() const { return IncomingArgSize; }
unsigned getGlobalBaseReg();
bool callsEhReturn() const { return CallsEhReturn; }
void setCallsEhReturn() { CallsEhReturn = true; }
bool callsEhDwarf() const { return CallsEhDwarf; }
void setCallsEhDwarf() { CallsEhDwarf = true; }
void createEhDataRegsFI();
int getEhDataRegFI(unsigned Reg) const { return EhDataRegFI[Reg]; }
unsigned getMaxCallFrameSize() const { return MaxCallFrameSize; }
void setMaxCallFrameSize(unsigned S) { MaxCallFrameSize = S; }
void setHasFpuInst(bool hasInst) { HasFpuInst = hasInst; }
bool getHasFpuInst() { return HasFpuInst; }
void setHasIalu2Inst(bool hasInst) { HasIalu2Inst = hasInst; }
bool getHasIalu2Inst() { return HasFpuInst; }
private:
virtual void anchor();
MachineFunction& MF;
/// VarArgsFrameIndex - FrameIndex for start of varargs area.
int VarArgsFrameIndex;
/// SRetReturnReg - Some subtargets require that sret lowering includes
/// returning the value of the returned struct in a register. This field
/// holds the virtual register into which the sret argument is passed.
unsigned SRetReturnReg;
unsigned MaxCallFrameSize;
/// True if function has a byval argument.
bool HasByvalArg;
/// Size of incoming argument area.
unsigned IncomingArgSize;
/// CallsEhReturn - Whether the function calls llvm.eh.return.
bool CallsEhReturn;
/// CallsEhDwarf - Whether the function calls llvm.eh.dwarf.
bool CallsEhDwarf;
/// Frame objects for spilling eh data registers.
int EhDataRegFI[2];
/// Global base reg virtual register
unsigned GlobalBaseReg;
bool EmitNOAT;
// Boolean flags to use in custom optimization passes
bool HasFpuInst;
bool HasIalu2Inst;
};
//@1 }
} // End llvm namespace
#endif