15#ifndef LLVM_TRANSFORMS_UTILS_LOOPVERSIONING_H
16#define LLVM_TRANSFORMS_UTILS_LOOPVERSIONING_H
89 LLVM_ABI std::pair<MDNode *, MDNode *>
123 Loop *NonVersionedLoop =
nullptr;
130 SmallVector<RuntimePointerCheck, 4> AliasChecks;
133 const SCEVPredicate &Preds;
137 DenseMap<const Value *, const RuntimeCheckingPtrGroup *> PtrToGroup;
140 DenseMap<const RuntimeCheckingPtrGroup *, MDNode *> GroupToScope;
143 DenseMap<const RuntimeCheckingPtrGroup *, MDNode *>
144 GroupToNonAliasingScopeList;
147 const LoopAccessInfo &LAI;
This header defines various interfaces for pass management in LLVM.
FunctionAnalysisManager FAM
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.
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
LLVM_ABI void annotateLoopWithNoAlias()
Annotate memory instructions in the versioned loop with no-alias metadata based on the memchecks issu...
Loop * getVersionedLoop()
Returns the versioned loop.
LLVM_ABI void prepareNoAliasMetadata()
Set up the aliasing scopes based on the memchecks.
LLVM_ABI 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...
LLVM_ABI std::pair< MDNode *, MDNode * > getNoAliasMetadataFor(const Instruction *OrigInst) const
Returns a pair containing the alias_scope and noalias metadata nodes for OrigInst,...
LLVM_ABI 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.
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 for passes that can be skipped.