[Mlir-commits] [mlir] [NFC][mlir][tensor] Use `ValueRange` instead of `SmallVector` in `tensor::createPadHighOp` (PR #144397)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Jun 16 10:14:37 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Fabian Mora (fabianmcg)
<details>
<summary>Changes</summary>
Use `ValueRange` instead of `SmallVector` in `tensor::createPadHighOp` for the `dynOutDims` arg.
---
Full diff: https://github.com/llvm/llvm-project/pull/144397.diff
2 Files Affected:
- (modified) mlir/include/mlir/Dialect/Tensor/Utils/Utils.h (+1-1)
- (modified) mlir/lib/Dialect/Tensor/Utils/Utils.cpp (+1-2)
``````````diff
diff --git a/mlir/include/mlir/Dialect/Tensor/Utils/Utils.h b/mlir/include/mlir/Dialect/Tensor/Utils/Utils.h
index 1a4733df3f187..a1ce4e252c2f4 100644
--- a/mlir/include/mlir/Dialect/Tensor/Utils/Utils.h
+++ b/mlir/include/mlir/Dialect/Tensor/Utils/Utils.h
@@ -30,7 +30,7 @@ namespace tensor {
// for _static_ dimensions.
PadOp createPadHighOp(RankedTensorType resType, Value source, Value pad,
bool nofold, Location loc, OpBuilder &builder,
- SmallVector<Value> dynOutDims = {});
+ ValueRange dynOutDims = std::nullopt);
// Creates dim ops for each dynamic dimension of the ranked tensor argument and
// returns these as values.
diff --git a/mlir/lib/Dialect/Tensor/Utils/Utils.cpp b/mlir/lib/Dialect/Tensor/Utils/Utils.cpp
index 11ae0108594dd..289296a07d9d3 100644
--- a/mlir/lib/Dialect/Tensor/Utils/Utils.cpp
+++ b/mlir/lib/Dialect/Tensor/Utils/Utils.cpp
@@ -24,8 +24,7 @@ using namespace mlir::tensor;
PadOp mlir::tensor::createPadHighOp(RankedTensorType resType, Value source,
Value pad, bool nofold, Location loc,
- OpBuilder &b,
- SmallVector<Value> dynOutDims) {
+ OpBuilder &b, ValueRange dynOutDims) {
// This assumption simplifies the following logic without limiting what's
// required _today_. If needed, we can relax it in the future.
``````````
</details>
https://github.com/llvm/llvm-project/pull/144397
More information about the Mlir-commits
mailing list