[PATCH] D53440: [LoopUnroll] allow customization for new-pass-manager version of LoopUnroll

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 19 10:52:03 PDT 2018


tejohnson added a comment.

In https://reviews.llvm.org/D53440#1269274, @fedor.sergeev wrote:

> I know that this change lacks testing, yet I have no idea on how to organize the test.
>  I'm doing this change for our downstream usage, so there currently no use of customized loop-unroll upstream and there are no command-line controls that could trigger it in a test.
>
> Any suggestions on how to test it?


I guess you could use a unittest that creates the pass and invokes it. But probably easier would be to create multiple instances of the LoopUnrollPass in the PassRegistry.def, that construct the pass with different options (see my comment below about passing the options via the constructor), and then invoke the different types of unrolling via "opt -passes=" in a test. See for example in PassRegistry.def "early-cse" vs "early-cse-memssa".



================
Comment at: include/llvm/Transforms/Scalar/LoopUnrollPass.h:49
 
+  /// Selector for the optional behavior - Partial unrolling.
+  /// Call with \p Partial being true to enable, false to disable.
----------------
I think the usual mechanism for the new PM is to pass options to the pass constructor. E.g. see InlinerPass.


Repository:
  rL LLVM

https://reviews.llvm.org/D53440





More information about the llvm-commits mailing list