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

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#ifndef LLVM_ANALYSIS_MEMORYSSAUPDATER_H

32#define LLVM_ANALYSIS_MEMORYSSAUPDATER_H

33

42

43namespace llvm {

44

49template <typename T, unsigned int N> class SmallSetVector;

50

54

56private:

58

59

60

62

65

66public:

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

88

89

91

92

93

96

101

102

103

104

108 bool IgnoreIncomingWithNoClones = false);

109

110

113

114

121

122

123

124

126 bool UpdateDTFirst = false);

127

130

135

136

137

138

139

140

141

142

143

144

145

146

147

150

151

152

153

154

155

156

157

158

159

160

161

162

163

166

167

168

169

170

173 bool IdenticalEdgesWereMerged = true);

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

197 bool CreationMustSucceed = true);

198

199

200

201

205

206

207

211

212

213

214

215

216

217

219

220

221

222

227

228

229

230

231

232

233

234

236

237

238

239

241

242

244

245private:

246

247 template

249

250

258 getPreviousDefRecursive(BasicBlock *,

262 template

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

290 bool CloneWasSimplified = false);

291

292 template

294 Iter ValuesBegin, Iter ValuesEnd,

298};

299}

300

301#endif

This file exposes an interface to building/using memory SSA to walk memory instructions using a use/d...

This file defines the SmallPtrSet class.

This file defines the SmallSet class.

This file defines the SmallVector class.

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

LLVM Basic Block Representation.

Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.

Wrapper class to LoopBlocksDFS that provides a standard begin()/end() interface for the DFS reverse p...

Represents a read-write access to memory, whether it is a must-alias, or a may-alias.

Represents phi nodes for memory accesses.

MemorySSA * getMemorySSA() const

Get handle on MemorySSA.

Definition MemorySSAUpdater.h:243

LLVM_ABI MemoryUseOrDef * createMemoryAccessBefore(Instruction *I, MemoryAccess *Definition, MemoryUseOrDef *InsertPt)

Create a MemoryAccess in MemorySSA before an existing MemoryAccess.

LLVM_ABI void insertDef(MemoryDef *Def, bool RenameUses=false)

Insert a definition into the MemorySSA IR.

LLVM_ABI void moveAfter(MemoryUseOrDef *What, MemoryUseOrDef *Where)

LLVM_ABI void removeEdge(BasicBlock *From, BasicBlock *To)

Update the MemoryPhi in To following an edge deletion between From and To.

LLVM_ABI void updateForClonedLoop(const LoopBlocksRPO &LoopBlocks, ArrayRef< BasicBlock * > ExitBlocks, const ValueToValueMapTy &VM, bool IgnoreIncomingWithNoClones=false)

Update MemorySSA after a loop was cloned, given the blocks in RPO order, the exit blocks and a 1:1 ma...

LLVM_ABI void changeToUnreachable(const Instruction *I)

Instruction I will be changed to an unreachable.

LLVM_ABI void removeDuplicatePhiEdgesBetween(const BasicBlock *From, const BasicBlock *To)

Update the MemoryPhi in To to have a single incoming edge from From, following a CFG change that repl...

LLVM_ABI void updatePhisWhenInsertingUniqueBackedgeBlock(BasicBlock *LoopHeader, BasicBlock *LoopPreheader, BasicBlock *BackedgeBlock)

Update MemorySSA when inserting a unique backedge block for a loop.

LLVM_ABI void insertUse(MemoryUse *Use, bool RenameUses=false)

MemorySSAUpdater(MemorySSA *MSSA)

Definition MemorySSAUpdater.h:67

LLVM_ABI void removeBlocks(const SmallSetVector< BasicBlock *, 8 > &DeadBlocks)

Remove all MemoryAcceses in a set of BasicBlocks about to be deleted.

LLVM_ABI void moveAllAfterSpliceBlocks(BasicBlock *From, BasicBlock *To, Instruction *Start)

From block was spliced into From and To.

LLVM_ABI MemoryAccess * createMemoryAccessInBB(Instruction *I, MemoryAccess *Definition, const BasicBlock *BB, MemorySSA::InsertionPlace Point, bool CreationMustSucceed=true)

Create a MemoryAccess in MemorySSA at a specified point in a block.

LLVM_ABI void removeMemoryAccess(MemoryAccess *, bool OptimizePhis=false)

Remove a MemoryAccess from MemorySSA, including updating all definitions and uses.

LLVM_ABI void applyInsertUpdates(ArrayRef< CFGUpdate > Updates, DominatorTree &DT)

Apply CFG insert updates, analogous with the DT edge updates.

LLVM_ABI MemoryUseOrDef * createMemoryAccessAfter(Instruction *I, MemoryAccess *Definition, MemoryAccess *InsertPt)

Create a MemoryAccess in MemorySSA after an existing MemoryAccess.

LLVM_ABI void updateForClonedBlockIntoPred(BasicBlock *BB, BasicBlock *P1, const ValueToValueMapTy &VM)

LLVM_ABI void applyUpdates(ArrayRef< CFGUpdate > Updates, DominatorTree &DT, bool UpdateDTFirst=false)

Apply CFG updates, analogous with the DT edge updates.

LLVM_ABI void moveAllAfterMergeBlocks(BasicBlock *From, BasicBlock *To, Instruction *Start)

From block was merged into To.

LLVM_ABI void moveToPlace(MemoryUseOrDef *What, BasicBlock *BB, MemorySSA::InsertionPlace Where)

LLVM_ABI void wireOldPredecessorsToNewImmediatePredecessor(BasicBlock *Old, BasicBlock *New, ArrayRef< BasicBlock * > Preds, bool IdenticalEdgesWereMerged=true)

A new empty BasicBlock (New) now branches directly to Old.

LLVM_ABI void updateExitBlocksForClonedLoop(ArrayRef< BasicBlock * > ExitBlocks, const ValueToValueMapTy &VMap, DominatorTree &DT)

Update phi nodes in exit block successors following cloning.

void removeMemoryAccess(const Instruction *I, bool OptimizePhis=false)

Remove MemoryAccess for a given instruction, if a MemoryAccess exists.

Definition MemorySSAUpdater.h:223

LLVM_ABI void moveBefore(MemoryUseOrDef *What, MemoryUseOrDef *Where)

Encapsulates MemorySSA, including all data associated with memory accesses.

InsertionPlace

Used in various insertion functions to specify whether we are talking about the beginning or end of a...

Class that has the common methods + fields of memory uses/defs.

Represents read-only accesses to memory.

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

A SetVector that performs no allocations if smaller than a certain size.

SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...

This class consists of common code factored out of the SmallVector class to reduce code duplication b...

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

Value handle that tracks a Value across RAUW.

A Use represents the edge between a Value definition and its users.

An efficient, type-erasing, non-owning reference to a callable.

This is an optimization pass for GlobalISel generic memory operations.

SmallDenseMap< MemoryPhi *, MemoryAccess * > PhiToDefMap

Definition MemorySSAUpdater.h:52

ValueMap< const Value *, WeakTrackingVH > ValueToValueMapTy

Definition MemorySSAUpdater.h:51

cfg::Update< BasicBlock * > CFGUpdate

Definition MemorySSAUpdater.h:53