[Mlir-commits] [mlir] 695c4f2 - [NFC][mlir][tensor] Use `ValueRange` instead of `SmallVector` in `tensor::createPadHighOp` (#144397)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jun 16 11:04:34 PDT 2025


Author: Fabian Mora
Date: 2025-06-16T14:04:30-04:00
New Revision: 695c4f2309718c441bc2e5b7dd3e3267737a12e6

URL: https://github.com/llvm/llvm-project/commit/695c4f2309718c441bc2e5b7dd3e3267737a12e6
DIFF: https://github.com/llvm/llvm-project/commit/695c4f2309718c441bc2e5b7dd3e3267737a12e6.diff

LOG: [NFC][mlir][tensor] Use `ValueRange` instead of `SmallVector` in `tensor::createPadHighOp` (#144397)

Use `ValueRange` instead of `SmallVector` in `tensor::createPadHighOp`
for the `dynOutDims` arg.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Tensor/Utils/Utils.h
    mlir/lib/Dialect/Tensor/Utils/Utils.cpp

Removed: 
    


################################################################################
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.


        


More information about the Mlir-commits mailing list