[ADT] Allow specifying the size of resulting `SmallVector` in `map_to_vector`
authorLaszlo Kindrat <laszlo@modular.com>
Mon, 15 May 2023 19:04:19 +0000 (15:04 -0400)
committerLaszlo Kindrat <laszlo@modular.com>
Thu, 25 May 2023 15:35:19 +0000 (11:35 -0400)
commitf3ece29b4658d60a1e7656bb9e67853376d094b7
tree607198269e24ad316069fba5bd1b65620462686a
parentaae8524bcc26cf04729f2bbc02ecb54233a587e4
[ADT] Allow specifying the size of resulting `SmallVector` in `map_to_vector`

This patch adds an overload for the `map_to_vector` helper template, exposing a parameter to control the size of the resulting `SmallVector`. A few call sites in mlir are updated to illustrate and test the change.

Differential Revision: https://reviews.llvm.org/D150601
llvm/include/llvm/ADT/SmallVectorExtras.h
mlir/include/mlir/IR/AffineMap.h
mlir/lib/IR/Builders.cpp
mlir/lib/IR/TypeUtilities.cpp