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

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_ANALYSIS_CAPTURETRACKING_H

14#define LLVM_ANALYSIS_CAPTURETRACKING_H

15

19

20namespace llvm {

21

23 class Use;

31

32

33

34

36

37

38

39

40

41

42

43

44

45

46

47

49 unsigned MaxUsesToExplore = 0);

50

51

52

53

54

55

56

57

61 unsigned MaxUsesToExplore = 0);

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

80 bool IncludeI = false,

81 unsigned MaxUsesToExplore = 0,

82 const LoopInfo *LI = nullptr);

83

84

85

86

87

88

89

90

91

96 const LoopInfo *LI = nullptr, unsigned MaxUsesToExplore = 0);

97

98

99

100

101

102

103

104

105

106

107

108

109 LLVM_ABI std::pair<Instruction *, CaptureComponents>

112 unsigned MaxUsesToExplore = 0);

113

114

116

118

120

124

128

132

134 };

135

136

137

138

140

142

144

145

146

148

149

150

151

153 };

154

156

157

158

160

161

162

163

164

165

167

168

169

170

171

172

174 };

175

176

177

178

179

180

181

182

183

186

187

188

189

190

191

192

193

194

195

197 unsigned MaxUsesToExplore = 0);

198}

199

200#endif

This file defines the DenseMap class.

Represents which components of the pointer may be captured in which location.

A parsed version of the target data layout string in and methods for querying it.

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

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

LLVM Value Representation.

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

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI std::pair< Instruction *, CaptureComponents > FindEarliestCapture(const Value *V, Function &F, bool ReturnCaptures, const DominatorTree &DT, CaptureComponents Mask, unsigned MaxUsesToExplore=0)

LLVM_ABI unsigned getDefaultMaxUsesToExploreForCaptureTracking()

getDefaultMaxUsesToExploreForCaptureTracking - Return default value of the maximal number of uses to ...

LLVM_ABI bool PointerMayBeCapturedBefore(const Value *V, bool ReturnCaptures, const Instruction *I, const DominatorTree *DT, bool IncludeI=false, unsigned MaxUsesToExplore=0, const LoopInfo *LI=nullptr)

PointerMayBeCapturedBefore - Return true if this pointer value may be captured by the enclosing funct...

CaptureComponents

Components of the pointer that may be captured.

LLVM_ABI bool PointerMayBeCaptured(const Value *V, bool ReturnCaptures, unsigned MaxUsesToExplore=0)

PointerMayBeCaptured - Return true if this pointer value may be captured by the enclosing function (w...

bool capturesAnything(CaptureComponents CC)

LLVM_ABI UseCaptureInfo DetermineUseCaptureKind(const Use &U, const Value *Base)

Determine what kind of capture behaviour U may exhibit.

bool capturesNothing(CaptureComponents CC)

This callback is used in conjunction with PointerMayBeCaptured.

Definition CaptureTracking.h:139

virtual bool shouldExplore(const Use *U)

shouldExplore - This is the use of a value derived from the pointer.

Action

Action returned from captures().

Definition CaptureTracking.h:141

@ ContinueIgnoringReturn

Continue traversal, but do not follow the return value of the user, even if it has additional capture...

Definition CaptureTracking.h:152

@ Continue

Continue traversal, and also follow the return value of the user if it has additional capture compone...

Definition CaptureTracking.h:147

@ Stop

Stop the traversal.

Definition CaptureTracking.h:143

virtual Action captured(const Use *U, UseCaptureInfo CI)=0

Use U directly captures CI.UseCC and additionally CI.ResultCC through the return value of the user of...

virtual void tooManyUses()=0

tooManyUses - The depth of traversal has breached a limit.

virtual ~CaptureTracker()

Capture information for a specific Use.

Definition CaptureTracking.h:115

bool isPassthrough() const

Definition CaptureTracking.h:129

CaptureComponents UseCC

Components captured by this use.

Definition CaptureTracking.h:117

UseCaptureInfo(CaptureComponents UseCC, CaptureComponents ResultCC=CaptureComponents::None)

Definition CaptureTracking.h:121

CaptureComponents ResultCC

Components captured by the return value of the user of this Use.

Definition CaptureTracking.h:119

static UseCaptureInfo passthrough()

Definition CaptureTracking.h:125