15#ifndef LLVM_TRANSFORMS_UTILS_LOOPVERSIONING_H
16#define LLVM_TRANSFORMS_UTILS_LOOPVERSIONING_H
88 std::pair<MDNode *, MDNode *>
122 Loop *NonVersionedLoop =
nullptr;
129 SmallVector<RuntimePointerCheck, 4> AliasChecks;
132 const SCEVPredicate &Preds;
136 DenseMap<const Value *, const RuntimeCheckingPtrGroup *> PtrToGroup;
139 DenseMap<const RuntimeCheckingPtrGroup *, MDNode *> GroupToScope;
142 DenseMap<const RuntimeCheckingPtrGroup *, MDNode *>
143 GroupToNonAliasingScopeList;
146 const LoopAccessInfo &LAI;
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.
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.
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...
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.
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.