[PATCH] [LoopDist/LoopVer] Move LoopVersioning to a new module, NFC

Ashutosh Nema ashutosh.nema at amd.com
Tue Jun 23 09:55:53 PDT 2015


Thanks Adam for working on this, it looks useful.

General comment:
Please add more comments to functions.


================
Comment at: lib/Transforms/Utils/LoopVersioning.cpp:41
@@ +40,3 @@
+  BasicBlock *MemCheckBB = VersionedLoop->getLoopPreheader();
+  std::tie(FirstCheckInst, MemRuntimeCheck) =
+      LAI.addRuntimeCheck(MemCheckBB->getTerminator(), PtrToPartition);
----------------
Loop pre header may be null, probably you need to check that.
If you are assuming a preheader then you can put a assert here.

================
Comment at: lib/Transforms/Utils/LoopVersioning.cpp:60
@@ +59,3 @@
+      cloneLoopWithPreheader(PH, MemCheckBB, VersionedLoop, VMap, ".lver.orig",
+                             LI, DT, NonVersionedLoopBlocks);
+  remapInstructionsInLoop(NonVersionedLoopBlocks, VMap);
----------------
This function does not care about exit blocks, you don't want to clone exit blocks ?

================
Comment at: lib/Transforms/Utils/LoopVersioning.cpp:75
@@ +74,3 @@
+
+void LoopVersioning::addPHINodes(
+    const SmallVectorImpl<Instruction *> &DefsUsedOutside) {
----------------
Add some comments what this function does

http://reviews.llvm.org/D10577

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list