commit | ed39b2b36924579036fc70c1b20772a204e4be44 | [log] [tgz] |
---|---|---|
author | Fabian Mora <fmora.dev@gmail.com> | Thu Jun 19 05:47:44 2025 -0400 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Jun 19 02:51:50 2025 -0700 |
tree | 56a8d689ecefa37f48113dad71220671d888a329 | |
parent | 507c7164ecc8ea52b21fc968147f8dd470dc484a [diff] |
[mlir][linalg] Add option to pad dynamic dims to `linalg::rewriteAsPaddedOp` (#144354) This patch makes the following changes: - Add a `ValueRange typeDynDims` argument to `linalg::makeComposedPadHighOp`, allowing to pad a tensor with dynamic dimensions using `tensor::createPadHighOp`. - Add a `DenseMap<std::pair<unsigned, unsigned>, OpFoldResult> sizeToPadTo;` option to `LinalgPaddingOptions`. This option allows setting the size to use when padding a dimension of an operand, allowing to pad operands even in the case they don't have a constant upper bounding box. If the value is not provided, then the constant upper bound is used by default. - Add a `use_prescribed_tensor_shapes` option to `transform.structured.pad`. If set to true then `tensor.dim` will be used as dimensions to compute the size of the padded dim instead of computing the constant upper bound. - This patch also changes the behavior for computing the padded shape `linalg::rewriteAsPaddedOp`, by using the newly added options in `LinalgPaddingOptions`. - Finally it adds tests verifying the behavior. GitOrigin-RevId: 97c1a2444574b32dd7a283c53be248c5dbbf62e9
See https://mlir.llvm.org/ for more information.