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

24class Loop;

25class SCEVPredicate;

26class ScalarEvolution;

27class LoopAccessInfo;

28class LoopInfo;

29struct RuntimeCheckingPtrGroup;

30typedef std::pair<const RuntimeCheckingPtrGroup *,

31 const RuntimeCheckingPtrGroup *>

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

89

90

91

92

93

94

97

98private:

99

100

101

102

103

105

106

107

110 }

111

112

113

114 Loop *VersionedLoop;

115

116

117 Loop *NonVersionedLoop = nullptr;

118

119

120

122

123

124 SmallVector<RuntimePointerCheck, 4> AliasChecks;

125

126

127 const SCEVPredicate &Preds;

128

129

130

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

132

133

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

135

136

137 DenseMap<const RuntimeCheckingPtrGroup *, MDNode *>

138 GroupToNonAliasingScopeList;

139

140

141 const LoopAccessInfo &LAI;

142 LoopInfo *LI;

143 DominatorTree *DT;

144 ScalarEvolution *SE;

145};

146

147

148

149

151public:

153};

154}

155

156#endif

This header defines various interfaces for pass management in LLVM.

FunctionAnalysisManager FAM

A container for analyses that lazily runs them and caches their results.

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.

PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)

This class emits a version of the loop where run-time checks ensure that may-alias pointers can't ove...

void annotateLoopWithNoAlias()

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

Loop * getVersionedLoop()

Returns the versioned loop.

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...

Loop * getNonVersionedLoop()

Returns the fall-back loop.

Represents a single loop in the control flow graph.

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

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.

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

Returns the instructions that use values defined in the loop.

ArrayRef(const T &OneElt) -> ArrayRef< T >

ValueMap< const Value *, WeakTrackingVH > ValueToValueMapTy

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