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

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 09:53:29 PDT 2015


anemet added inline comments.

================
Comment at: lib/Transforms/Utils/LoopVersioning.cpp:34-40
@@ -33,1 +33,9 @@
 
+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));
+}
----------------
Can't we initialize Checks in the constructor initializer list, i.e. Checks(LAI.getRuntimePointerChecking()->getChecks())?

Is the reason that getChecks return SmallVectorImpl rather than SmallVector<.., 4> ?

If yes then I think we should probably change getChecks to return SmallVector rather than SmallVectorImpl.

What do you think?


Repository:
  rL LLVM

http://reviews.llvm.org/D11892





More information about the llvm-commits mailing list