This patch adds a utility based on SuperVectorizer to vectorize an
affine loop nest using a given vectorization strategy. This strategy allows
targeting specific loops for vectorization instead of relying of the
SuperVectorizer analysis to choose the right loops to vectorize.
As part of the refactoring needed in SuperVectorizer to make the necessary
pieces public, we replaced NestedMatcher with SmallVector in some functions as
the mechanism to pass loop candidates over the algorithm. This allows us not to
expose NestedMatcher in the public API so that the client can provide loop
candidates using any other approach.
Please, let me know if you have any other ideas to keep the public API generic.
Another option could be using 'std::vector<SmallVector<AffineForOp, 2>>', to
preserve the parent-children relationship (we use something similar in
utility 'gatherLoops'[1].
[1] https://github.com/llvm/llvm-project/blob/master/mlir/include/mlir/Transforms/LoopUtils.h#L273
on a single loop nest