LLVM: include/llvm/Transforms/Utils/LoopVersioning.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15#ifndef LLVM_TRANSFORMS_UTILS_LOOPVERSIONING_H

16#define LLVM_TRANSFORMS_UTILS_LOOPVERSIONING_H

17

21

22namespace llvm {

23

33

34template class ArrayRef;

35

36

37

38

39

40

42public:

43

44

45

46

50

51

52

53

54

55

56

57

58

59

60

61

62

63

65

66

67

69

70

71

72

74

75

76

78

79

80

81

82

83

85

86

87

88 std::pair<MDNode *, MDNode *>

90

91

92

94

95

96

97

98

99

102

103private:

104

105

106

107

108

110

111

112

115 }

116

117

118

119 Loop *VersionedLoop;

120

121

122 Loop *NonVersionedLoop = nullptr;

123

124

125

127

128

129 SmallVector<RuntimePointerCheck, 4> AliasChecks;

130

131

132 const SCEVPredicate &Preds;

133

134

135

136 DenseMap<const Value *, const RuntimeCheckingPtrGroup *> PtrToGroup;

137

138

139 DenseMap<const RuntimeCheckingPtrGroup *, MDNode *> GroupToScope;

140

141

142 DenseMap<const RuntimeCheckingPtrGroup *, MDNode *>

143 GroupToNonAliasingScopeList;

144

145

146 const LoopAccessInfo &LAI;

147 LoopInfo *LI;

148 DominatorTree *DT;

149 ScalarEvolution *SE;

150};

151

152

153

154

159}

160

161#endif

This header defines various interfaces for pass management in LLVM.

FunctionAnalysisManager FAM

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

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

Drive the analysis of memory accesses in the loop.

Expose LoopVersioning as a pass.

Definition LoopVersioning.h:155

PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)

void annotateLoopWithNoAlias()

Annotate memory instructions in the versioned loop with no-alias metadata based on the memchecks issu...

Loop * getVersionedLoop()

Returns the versioned loop.

Definition LoopVersioning.h:73

void prepareNoAliasMetadata()

Set up the aliasing scopes based on the memchecks.

void annotateInstWithNoAlias(Instruction *VersionedInst, const Instruction *OrigInst)

Add the noalias annotations to VersionedInst.

void versionLoop()

Performs the CFG manipulation part of versioning the loop including the DominatorTree and LoopInfo up...

Definition LoopVersioning.h:64

std::pair< MDNode *, MDNode * > getNoAliasMetadataFor(const Instruction *OrigInst) const

Returns a pair containing the alias_scope and noalias metadata nodes for OrigInst,...

LoopVersioning(const LoopAccessInfo &LAI, ArrayRef< RuntimePointerCheck > Checks, Loop *L, LoopInfo *LI, DominatorTree *DT, ScalarEvolution *SE)

Expects LoopAccessInfo, Loop, LoopInfo, DominatorTree as input.

Loop * getNonVersionedLoop()

Returns the fall-back loop.

Definition LoopVersioning.h:77

Represents a single loop in the control flow graph.

A set of analyses that are preserved following a run of a transformation pass.

This class represents an assumption made using SCEV expressions which can be checked at run-time.

The main scalar evolution driver.

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

This is an optimization pass for GlobalISel generic memory operations.

std::pair< const RuntimeCheckingPtrGroup *, const RuntimeCheckingPtrGroup * > RuntimePointerCheck

A memcheck which made up of a pair of grouped pointers.

LLVM_ABI SmallVector< Instruction *, 8 > findDefsUsedOutsideOfLoop(Loop *L)

Returns the instructions that use values defined in the loop.

ValueMap< const Value *, WeakTrackingVH > ValueToValueMapTy

AnalysisManager< Function > FunctionAnalysisManager

Convenience typedef for the Function analysis manager.

A CRTP mix-in to automatically provide informational APIs needed for passes.