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

Adam Nemet anemet at apple.com
Mon Jun 22 21:33:00 PDT 2015


================
Comment at: include/llvm/Transforms/Utils/LoopVersioning.h:10
@@ +9,3 @@
+//
+// This file defines various functions that are used to clone chunks of LLVM
+// code for various purposes.  This varies from copying whole modules into new
----------------
hfinkel wrote:
> This is a stale comment?
Yes, sorry.

================
Comment at: include/llvm/Transforms/Utils/LoopVersioning.h:44
@@ +43,3 @@
+  /// \brief Performs the CFG manipulation part of versioning the loop including
+  /// the DominatorTree and LoopInfo updates.
+  void versionLoop(Pass *P);
----------------
hfinkel wrote:
> From this interface, I find it very unclear how you get out the new versioned loop after the CFG mutation is complete.
The loop that was used to construct the class will be the "versioned" loop i.e. the loop that will get control if all the memchecks pass.

This is the loop that typically, the client transform will be interested in modifying.  E.g. this is what LoopDistribute does.

This is sort of implicit because the versioning is optional.  I think this is a typical algorithm:

  for each loop L:
    analyze L
    if versioning is necessary version L
    transform L

The versioning itself is an optional step and you don't change the loop underlying the transformation if versioning was necessary.

Both loops (versioned, unversioned) are attributes of the class, so we can add APIs to query them as we need them.

Let me know if you'd be OK just commenting the above or you're requesting an actual API change.

Thanks very much for the review!

Adam

http://reviews.llvm.org/D10577

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






More information about the llvm-commits mailing list