[PATCH] D53895: [LoopUnroll] add parsing for unroll parameters in -passes pipeline
Philip Pfaffe via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 3 03:09:10 PST 2019
philip.pfaffe added inline comments.
================
Comment at: lib/Passes/PassBuilder.cpp:1253-1257
+/// This performs customized parsing of pass name with parameters.
+///
+/// We do not need parametrization of passes in textual pipeline very often,
+/// yet on a rare occasion ability to specify parameters right there can be
+/// useful.
----------------
fedor.sergeev wrote:
> chandlerc wrote:
> > Please explain how the parser type parameter works and what is expected of it.
> >
> > But better yet, how about we just make this routine accept a callable rather than a class, and have this functions return type be the same as that callable?
> >
> > Something like:
> > ```
> > template <typename ParseCallableT>
> > auto parsePassWithParameters(ParseCallableT Parser, ...) -> decltype(std::decl_ref<ParseCallableT>()("")) {
> > ...
> > }
> > ```
> >
> > I suppose you could use result_of or some other trait instead, not sure it'd be any simpler.
> >
> > The key idea is to make this just a wrapper of another callable which strips off the pass name and the angle brackets.
> >
> > To handle the empty case, just call the callable with an empty string, and have it return the default value.
> To avoid complications with ParametersT type deduction decided to pass parameters type explicitly into the macro/parsing helper template.
Can you elaborate?
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D53895/new/
https://reviews.llvm.org/D53895
More information about the llvm-commits
mailing list