LLVM: lib/CodeGen/RegisterCoalescer.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_LIB_CODEGEN_REGISTERCOALESCER_H
15#define LLVM_LIB_CODEGEN_REGISTERCOALESCER_H
16
19
20namespace llvm {
21
25
26
27
28
31
32
33
35
36
38
39
40 unsigned DstIdx = 0;
41
42
43 unsigned SrcIdx = 0;
44
45
46 bool Partial = false;
47
48
49 bool CrossClass = false;
50
51
52
53 bool Flipped = false;
54
55
56
57
59
60public:
62
63
64
67 : TRI(tri), DstReg(PhysReg), SrcReg(VirtReg) {}
68
69
70
72
73
74
76
77
78
80
81
82 bool isPhys() const { return !NewRC; }
83
84
85
86 bool isPartial() const { return Partial; }
87
88
89
91
92
93
94 bool isFlipped() const { return Flipped; }
95
96
97
99
100
102
103
104 unsigned getDstIdx() const { return DstIdx; }
105
106
107 unsigned getSrcIdx() const { return SrcIdx; }
108
109
111};
112
113}
114
115#endif
unsigned getDstIdx() const
Return the subregister index that DstReg will be coalesced into, or 0.
Definition RegisterCoalescer.h:104
bool isFlipped() const
Return true when getSrcReg is the register being defined by the original copy instruction.
Definition RegisterCoalescer.h:94
bool isPartial() const
Return true if the original copy instruction did not copy the full register, but was a subreg operati...
Definition RegisterCoalescer.h:86
bool flip()
Swap SrcReg and DstReg.
bool isPhys() const
Return true if DstReg is a physical register.
Definition RegisterCoalescer.h:82
bool isCrossClass() const
Return true if DstReg is virtual and NewRC is a smaller register class than DstReg's.
Definition RegisterCoalescer.h:90
Register getDstReg() const
Return the register (virtual or physical) that will remain after coalescing.
Definition RegisterCoalescer.h:98
bool isCoalescable(const MachineInstr *) const
Return true if MI is a copy instruction that will become an identity copy after coalescing.
CoalescerPair(const TargetRegisterInfo &tri)
Definition RegisterCoalescer.h:61
CoalescerPair(Register VirtReg, MCRegister PhysReg, const TargetRegisterInfo &tri)
Create a CoalescerPair representing a virtreg-to-physreg copy.
Definition RegisterCoalescer.h:65
const TargetRegisterClass * getNewRC() const
Return the register class of the coalesced register.
Definition RegisterCoalescer.h:110
bool setRegisters(const MachineInstr *)
Set registers to match the copy instruction MI.
unsigned getSrcIdx() const
Return the subregister index that SrcReg will be coalesced into, or 0.
Definition RegisterCoalescer.h:107
Register getSrcReg() const
Return the virtual register that will be coalesced away.
Definition RegisterCoalescer.h:101
Wrapper class representing physical registers. Should be passed by value.
Representation of each machine instruction.
Wrapper class representing virtual and physical registers.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This is an optimization pass for GlobalISel generic memory operations.