[LVer] Remove unused Pass parameter from versionLoop, NFC
[oota-llvm.git] / include / llvm / Transforms / Utils / LoopVersioning.h
index 009fba48c6a38fb2d0094935e3f60563e41024b2..8c87a62d84ce9971d59cff7c0725ffe73782beef 100644 (file)
@@ -31,13 +31,16 @@ class LoopInfo;
 /// already has a preheader.
 class LoopVersioning {
 public:
-  LoopVersioning(const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI,
-                 DominatorTree *DT,
-                 const SmallVector<int, 8> *PtrToPartition = nullptr);
+  /// \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);
 
-  /// \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.
@@ -52,7 +55,7 @@ public:
   ///        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.
@@ -79,17 +82,13 @@ private:
   /// 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;
 
+  /// \brief The set of checks that we are versioning for.
+  SmallVector<RuntimePointerChecking::PointerCheck, 4> Checks;
+
   /// \brief Analyses used.
   const LoopAccessInfo &LAI;
   LoopInfo *LI;