[PATCH] D11892: LoopVersioning: Use default LAA runtimeCheck, When input check not provided.

Ashutosh Nema via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 23:14:56 PDT 2015


ashutosh.nema updated this revision to Diff 31773.
ashutosh.nema added a comment.

Incorporated comments from Adam.


Repository:
  rL LLVM

http://reviews.llvm.org/D11892

Files:
  include/llvm/Transforms/Utils/LoopVersioning.h
  lib/Transforms/Utils/LoopVersioning.cpp

Index: lib/Transforms/Utils/LoopVersioning.cpp
===================================================================
--- lib/Transforms/Utils/LoopVersioning.cpp
+++ lib/Transforms/Utils/LoopVersioning.cpp
@@ -31,6 +31,15 @@
   assert(L->getLoopPreheader() && "No preheader");
 }
 
+LoopVersioning::LoopVersioning(const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI,
+                               DominatorTree *DT)
+    : VersionedLoop(L), NonVersionedLoop(nullptr), LAI(LAI), LI(LI), DT(DT) {
+  assert(L->getExitBlock() && "No single exit block");
+  assert(L->getLoopPreheader() && "No preheader");
+  const auto &RtChecks = LAI.getRuntimePointerChecking()->getChecks();
+  std::copy(RtChecks.begin(), RtChecks.end(), std::back_inserter(Checks));
+}
+
 void LoopVersioning::versionLoop(Pass *P) {
   Instruction *FirstCheckInst;
   Instruction *MemRuntimeCheck;
Index: include/llvm/Transforms/Utils/LoopVersioning.h
===================================================================
--- include/llvm/Transforms/Utils/LoopVersioning.h
+++ include/llvm/Transforms/Utils/LoopVersioning.h
@@ -31,10 +31,17 @@
 /// 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);
 
+  /// \brief Expects LoopAccessInfo, Loop, LoopInfo, DominatorTree as input.
+  /// It uses default runtime check provided by LoopAccessInfo.
+  LoopVersioning(const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI,
+                 DominatorTree *DT);
+
   /// \brief Performs the CFG manipulation part of versioning the loop including
   /// the DominatorTree and LoopInfo updates.
   ///


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11892.31773.patch
Type: text/x-patch
Size: 1879 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150811/6d71c3f2/attachment.bin>


More information about the llvm-commits mailing list