[Mlir-commits] [mlir] [mlir][Transforms] Improve `replaceOpWithMultiple` API (PR #132608)
Matthias Springer
llvmlistbot at llvm.org
Tue Mar 25 10:21:32 PDT 2025
================
@@ -192,7 +192,7 @@ struct LegalizeArithConstantOpsByDecomposition
auto tileCount = getNumberOfSMETilesForVectorType(vectorType);
auto tileSplat = rewriter.create<arith::ConstantOp>(
constantOp.getLoc(), denseAttr.resizeSplat(smeTileType));
- SmallVector<Value> repl(tileCount, tileSplat);
+ SmallVector<Value, 1> repl(tileCount, tileSplat);
----------------
matthias-springer wrote:
`SmallVector<Value, 1>` is used as an internal data structure in the dialect conversion. The vast majority of conversions are 1:1 conversions, so I optimized the code base for that case.
The conversion mapping stores `SmallVector<Value, 1>`; it used to be just `Value` before the dialect conversion supported 1:N. We have an alias for `SmallVector<Value, 1>`, I can make it public and then use here.
The reason why I use `SmallVector<Value, 1>` here is so that we can avoid copying the vector. It will be heap-allocated in the dialect conversion driver anyway.
https://github.com/llvm/llvm-project/pull/132608
More information about the Mlir-commits
mailing list