[Mlir-commits] [llvm] [mlir] [TOSA] Add Tosa_Shape type and ConstShapeOp (PR #122547)

Tai Ly llvmlistbot at llvm.org
Thu Mar 20 09:26:05 PDT 2025


Tai78641 wrote:

> Is there a helper to create `ConstShapeOp `or `Tosa_Shape `types in C++? I'm updating some patterns for tosa.tile and having to write something like the following snippet is quite wordyIMO:
> 
> ```
> auto constantShapeOp = rewriter.create<ConstShapeOp>(
>         getLoc(),
>         shapeType::get(getContext(), rank),
>         DenseIntElementsAttr::get(
>             RankedTensorType::get({rank}, rewriter.getIndexType()),
>             multiplies));
> ```

There is getTosaConstShape in /mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp

https://github.com/llvm/llvm-project/pull/122547


More information about the Mlir-commits mailing list