[LoopVer] Optionally allow using memchecks from LAA

r243382 changed the behavior to always require a set of memchecks to be
passed to LoopVer.  This change restores the prior behavior as an
alternative to the new behavior.  This allows the checks to be
implicitly taken from the LAA object.

Patch by Ashutosh Nema!

llvm-svn: 244763
diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
index 4d2b1ee..ad2de24 100644
--- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp
+++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
@@ -31,6 +31,15 @@
   assert(L->getLoopPreheader() && "No preheader");
 }
 
+LoopVersioning::LoopVersioning(const LoopAccessInfo &LAInfo, Loop *L,
+                               LoopInfo *LI, DominatorTree *DT)
+    : VersionedLoop(L), NonVersionedLoop(nullptr),
+      Checks(LAInfo.getRuntimePointerChecking()->getChecks()), LAI(LAInfo),
+      LI(LI), DT(DT) {
+  assert(L->getExitBlock() && "No single exit block");
+  assert(L->getLoopPreheader() && "No preheader");
+}
+
 void LoopVersioning::versionLoop(Pass *P) {
   Instruction *FirstCheckInst;
   Instruction *MemRuntimeCheck;