/// already has a preheader.
class LoopVersioning {
public:
+ /// \brief Expects MemCheck, LoopAccessInfo, Loop, LoopInfo, DominatorTree
+ /// as input. It uses runtime check provided by user.
LoopVersioning(SmallVector<RuntimePointerChecking::PointerCheck, 4> Checks,
const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI,
- DominatorTree *DT,
- const SmallVector<int, 8> *PtrToPartition = nullptr);
+ DominatorTree *DT);
- /// \brief Returns true if we need memchecks to disambiguate may-aliasing
- /// accesses.
- bool needsRuntimeChecks() const;
+ /// \brief Expects LoopAccessInfo, Loop, LoopInfo, DominatorTree as input.
+ /// It uses default runtime check provided by LoopAccessInfo.
+ LoopVersioning(const LoopAccessInfo &LAInfo, Loop *L, LoopInfo *LI,
+ DominatorTree *DT);
/// \brief Performs the CFG manipulation part of versioning the loop including
/// the DominatorTree and LoopInfo updates.
/// analyze L
/// if versioning is necessary version L
/// transform L
- void versionLoop(Pass *P);
+ void versionLoop();
/// \brief Adds the necessary PHI nodes for the versioned loops based on the
/// loop-defined values used outside of the loop.
/// loop may alias (memchecks failed).
Loop *NonVersionedLoop;
- /// \brief For each memory pointer it contains the partitionId it is used in.
- /// If nullptr, no partitioning is used.
- ///
- /// The I-th entry corresponds to I-th entry in LAI.getRuntimePointerCheck().
- /// If the pointer is used in multiple partitions the entry is set to -1.
- const SmallVector<int, 8> *PtrToPartition;
-
/// \brief This maps the instructions from VersionedLoop to their counterpart
/// in NonVersionedLoop.
ValueToValueMapTy VMap;