Go to the documentation of this file.
15 #ifndef LLVM_TRANSFORMS_UTILS_LOOPVERSIONING_H
16 #define LLVM_TRANSFORMS_UTILS_LOOPVERSIONING_H
26 class ScalarEvolution;
29 struct RuntimeCheckingPtrGroup;
30 typedef std::pair<
const RuntimeCheckingPtrGroup *,
31 const RuntimeCheckingPtrGroup *>
34 template <
typename T>
class ArrayRef;
117 Loop *NonVersionedLoop =
nullptr;
124 SmallVector<RuntimePointerCheck, 4> AliasChecks;
127 const SCEVPredicate &Preds;
131 DenseMap<const Value *, const RuntimeCheckingPtrGroup *> PtrToGroup;
134 DenseMap<const RuntimeCheckingPtrGroup *, MDNode *> GroupToScope;
137 DenseMap<const RuntimeCheckingPtrGroup *, MDNode *>
138 GroupToNonAliasingScopeList;
141 const LoopAccessInfo &LAI;
A set of analyses that are preserved following a run of a transformation pass.
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.
A CRTP mix-in to automatically provide informational APIs needed for passes.
Represents a single loop in the control flow graph.
The main scalar evolution driver.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
FunctionAnalysisManager FAM
SmallVector< Instruction *, 8 > findDefsUsedOutsideOfLoop(Loop *L)
Returns the instructions that use values defined in the loop.
void annotateInstWithNoAlias(Instruction *VersionedInst, const Instruction *OrigInst)
Add the noalias annotations to VersionedInst.
Expose LoopVersioning as a pass.
void prepareNoAliasMetadata()
Set up the aliasing scopes based on the memchecks.
Loop * getNonVersionedLoop()
Returns the fall-back loop.
This class emits a version of the loop where run-time checks ensure that may-alias pointers can't ove...
Drive the analysis of memory accesses in the loop.
ValueMap< const Value *, WeakTrackingVH > ValueToValueMapTy
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
LoopVersioning(const LoopAccessInfo &LAI, ArrayRef< RuntimePointerCheck > Checks, Loop *L, LoopInfo *LI, DominatorTree *DT, ScalarEvolution *SE)
Expects LoopAccessInfo, Loop, LoopInfo, DominatorTree as input.
void versionLoop()
Performs the CFG manipulation part of versioning the loop including the DominatorTree and LoopInfo up...
A container for analyses that lazily runs them and caches their results.
void annotateLoopWithNoAlias()
Annotate memory instructions in the versioned loop with no-alias metadata based on the memchecks issu...
Loop * getVersionedLoop()
Returns the versioned loop.