LLVM: include/llvm/CodeGen/RDFLiveness.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12#ifndef LLVM_CODEGEN_RDFLIVENESS_H

13#define LLVM_CODEGEN_RDFLIVENESS_H

14

19#include

20#include

21#include <unordered_map>

22#include <unordered_set>

23#include

24

25namespace llvm {

26

32

33namespace rdf {

35

36using NodeRef = std::pair<NodeId, LaneBitmask>;

37

38}

39}

40}

41

42namespace std {

43

44template <> struct hash<llvm::rdf::detail::NodeRef> {

46 return std::hashllvm::rdf::NodeId{}(R.first) ^

47 std::hashllvm::LaneBitmask::Type{}(R.second.getAsInteger());

48 }

49};

50

51}

52

54

56public:

59 using NodeRefSet = std::unordered_set;

60 using RefMap = std::unordered_map<RegisterId, NodeRefSet>;

61

63 : DFG(g), TRI(g.getTRI()), PRI(g.getPRI()), MDT(g.getDT()),

64 MDF(g.getDF()), LiveMap(g.getPRI()), Empty(), NoRegs(g.getPRI()) {}

65

67 bool TopShadows, bool FullChain,

69

74

78

81

85

90

93

96

98 auto F = RealUseMap.find(P);

99 return F == RealUseMap.end() ? Empty : F->second;

100 }

101

107

109

110private:

119 bool Trace = false;

120

121

122

123

125

126

127

128

129

130

132

133

134 std::map<MachineBasicBlock *, std::set<MachineBasicBlock *>> IIDF;

135

136

137 std::map<MachineBasicBlock *, RefMap> PhiLON;

138

139

140

141

142

143

144 std::map<MachineBasicBlock *, RefMap> PhiLOX;

145

148 void emptify(RefMap &M);

149

150 std::pair<NodeSet, bool>

153 unsigned Nest, unsigned MaxNest);

154};

155

157

158}

159

160#endif

static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")

This file defines the DenseMap class.

A common definition of LaneBitmask for use in TableGen and CodeGen.

Register const TargetRegisterInfo * TRI

LocallyHashedType DenseMapInfo< LocallyHashedType >::Empty

INLINE void g(uint32_t *state, size_t a, size_t b, size_t c, size_t d, uint32_t x, uint32_t y)

DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...

MachineRegisterInfo - Keep track of information for virtual and physical registers,...

TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...

This class implements an extremely fast bulk output stream that can only output to a stream.

std::pair< NodeId, LaneBitmask > NodeRef

Definition RDFLiveness.h:36

Print(const T &, const DataFlowGraph &) -> Print< T >

raw_ostream & operator<<(raw_ostream &OS, const Print< RegisterRef > &P)

std::set< NodeId > NodeSet

SmallVector< Node, 4 > NodeList

This is an optimization pass for GlobalISel generic memory operations.

Implement std::hash so that hash_code can be used in STL containers.

LiveMapType & getLiveMap()

Definition RDFLiveness.h:94

NodeList getAllReachingDefs(RegisterRef RefRR, NodeAddr< RefNode * > RefA, bool TopShadows, bool FullChain, const RegisterAggr &DefRRs)

std::unordered_set< NodeRef > NodeRefSet

Definition RDFLiveness.h:59

const RefMap & getRealUses(NodeId P) const

Definition RDFLiveness.h:97

NodeAddr< RefNode * > getNearestAliasedRef(RegisterRef RefRR, NodeAddr< InstrNode * > IA)

Find the nearest ref node aliased to RefRR, going upwards in the data flow, starting from the instruc...

RegisterAggrMap< MachineBasicBlock * > LiveMapType

Definition RDFLiveness.h:57

NodeList getAllReachingDefs(NodeAddr< RefNode * > RefA)

Definition RDFLiveness.h:70

Liveness(MachineRegisterInfo &mri, const DataFlowGraph &g)

Definition RDFLiveness.h:62

detail::NodeRef NodeRef

Definition RDFLiveness.h:58

NodeList getAllReachingDefs(RegisterRef RefRR, NodeAddr< RefNode * > RefA)

Definition RDFLiveness.h:75

std::pair< NodeSet, bool > getAllReachingDefsRec(RegisterRef RefRR, NodeAddr< RefNode * > RefA, NodeSet &Visited, const NodeSet &Defs)

NodeSet getAllReachedUses(RegisterRef RefRR, NodeAddr< DefNode * > DefA)

Definition RDFLiveness.h:82

void trace(bool T)

Definition RDFLiveness.h:108

std::unordered_map< RegisterId, NodeRefSet > RefMap

Definition RDFLiveness.h:60

const LiveMapType & getLiveMap() const

Definition RDFLiveness.h:95

NodeSet getAllReachedUses(RegisterRef RefRR, NodeAddr< DefNode * > DefA, const RegisterAggr &DefRRs)

std::size_t operator()(llvm::rdf::detail::NodeRef R) const

Definition RDFLiveness.h:45