LLVM: include/llvm/Analysis/GenericDomTreeUpdater.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_ANALYSIS_GENERICDOMTREEUPDATER_H

15#define LLVM_ANALYSIS_GENERICDOMTREEUPDATER_H

16

20

21namespace llvm {

22

23template <typename DerivedT, typename DomTreeT, typename PostDomTreeT>

25 DerivedT &derived() { return *static_cast<DerivedT *>(this); }

26 const DerivedT &derived() const {

27 return *static_cast<const DerivedT *>(this);

28 }

29

30public:

33 using UpdateT = typename DomTreeT::UpdateType;

34

51

53

55 "Pending updates were not flushed by derived class.");

56 }

57

58

60

61

63

64

66

67

69

70

71

72

73

75

76

77

80 return false;

82 }

83

84

85

86

87

88

91 }

92

93

94

96 if (DT)

97 return false;

99 }

100

101

102

104 if (PDT)

105 return false;

107 }

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133 template void recalculate(FuncT &F);

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

151

152

153

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

179

180

181

182

183

184

185

186

187

188

189

190

191

193

194

195

196

198

199

200

201

206 }

207

208

209

210

212

213protected:

214

215

220 };

221

224 union {

227 };

230 };

231

235 DomTreeT *DT = nullptr;

236 PostDomTreeT *PDT = nullptr;

241

242

244

245 return Update.getFrom() == Update.getTo();

246 }

247

248

250

251

253

254

255

256

258

259

260

262

263

264

266

267

268

270

271private:

274 template void applyUpdatesImpl();

275};

276

277}

278

279#endif

static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")

#define LLVM_DUMP_METHOD

Mark debug helper function definitions like dump() that should not be stripped from debug builds.

assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

This file defines the SmallSet class.

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

SmallPtrSet< BasicBlockT *, 8 > DeletedBBs

DomTreeT & getDomTree()

Flush DomTree updates and return DomTree.

PostDomTreeT & getPostDomTree()

Flush PostDomTree updates and return PostDomTree.

bool isEager() const

Returns true if the current strategy is Eager.

void applyPostDomTreeUpdates()

Helper function to apply all pending PostDomTree updates.

void applyUpdatesPermissive(ArrayRef< UpdateT > Updates)

Submit updates to all available trees.

GenericDomTreeUpdater(PostDomTreeT &PDT_, UpdateStrategy Strategy_)

void applyUpdates(ArrayRef< UpdateT > Updates)

Submit updates to all available trees.

bool IsRecalculatingPostDomTree

void eraseDelBBNode(BasicBlockT *DelBB)

Erase Basic Block node before it is unlinked from Function in the DomTree and PostDomTree.

void flush()

Apply all pending updates to available trees and flush all BasicBlocks awaiting deletion.

bool hasPendingUpdates() const

Returns true if either of DT or PDT is valid and the tree has at least one update pending.

bool hasDomTree() const

Returns true if it holds a DomTreeT.

bool isSelfDominance(UpdateT Update) const

Returns true if the update is self dominance.

const UpdateStrategy Strategy

typename DomTreeT::UpdateType UpdateT

bool hasPostDomTree() const

Returns true if it holds a PostDomTreeT.

typename DomTreeT::NodeType BasicBlockT

GenericDomTreeUpdater(DomTreeT &DT_, UpdateStrategy Strategy_)

void tryFlushDeletedBB()

Helper function to flush deleted BasicBlocks if all available trees are up-to-date.

bool isBBPendingDeletion(BasicBlockT *DelBB) const

Returns true if DelBB is awaiting deletion.

GenericDomTreeUpdater(DomTreeT *DT_, PostDomTreeT *PDT_, UpdateStrategy Strategy_)

void dropOutOfDateUpdates()

Drop all updates applied by all available trees and delete BasicBlocks if all available trees are up-...

bool IsRecalculatingDomTree

bool hasPendingPostDomTreeUpdates() const

Returns true if there are PostDomTreeT updates queued.

size_t PendPDTUpdateIndex

void recalculate(FuncT &F)

Notify DTU that the entry block was replaced.

void splitCriticalEdge(BasicBlockT *FromBB, BasicBlockT *ToBB, BasicBlockT *NewBB)

Apply updates that the critical edge (FromBB, ToBB) has been split with NewBB.

void applyDomTreeUpdates()

Helper function to apply all pending DomTree updates.

GenericDomTreeUpdater(UpdateStrategy Strategy_)

GenericDomTreeUpdater(DomTreeT &DT_, PostDomTreeT &PDT_, UpdateStrategy Strategy_)

GenericDomTreeUpdater(PostDomTreeT *PDT_, UpdateStrategy Strategy_)

bool isUpdateValid(UpdateT Update) const

Returns true if the update appears in the LLVM IR.

SmallVector< DomTreeUpdate, 16 > PendUpdates

bool hasPendingDeletedBB() const

Returns true if there is BasicBlockT awaiting deletion.

LLVM_DUMP_METHOD void dump() const

Debug method to help view the internal state of this class.

bool hasPendingDomTreeUpdates() const

Returns true if there are DomTreeT updates queued.

GenericDomTreeUpdater(DomTreeT *DT_, UpdateStrategy Strategy_)

bool isLazy() const

Returns true if the current strategy is Lazy.

bool contains(ConstPtrType Ptr) const

SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

This is an optimization pass for GlobalISel generic memory operations.

Helper structure used to hold all the basic blocks involved in the split of a critical edge.

DomTreeUpdate(CriticalEdge E)

DomTreeUpdate(UpdateT Update)