[Mlir-commits] [mlir] [mlir][linalg] convert arith ops to destination-passing-style. (PR #157854)

Javed Absar llvmlistbot at llvm.org
Tue Sep 16 02:16:59 PDT 2025


javedabsar1 wrote:

> > After this change, e.g. ` %0 = arith.uitofp %arg0 : tensor<?xi32> to tensor<?xf32>` will get rewritten as:
> > ```
> >     %c0 = arith.constant 0 : index
> >     %dim = tensor.dim %arg0, %c0 : tensor<?xi32>
> >     %0 = tensor.empty(%dim) : tensor<?xf32>
> >     %1 = linalg.generic
> >           {indexing_maps = [#map, #map], iterator_types = ["parallel"]}
> >           ins(%arg0 : tensor<?xi32>) outs(%0 : tensor<?xf32>) {
> >            ^bb0(%in: i32, %out: f32):
> >              %2 = arith.uitofp %in : i32 to f32
> >              linalg.yield %2 : f32
> >     } -> tensor<?xf32>
> > ```
> 
> This is covered by the existing `-convert-elementwise-to-linalg` pass. Not sure if proposed new pass fully duplicates this logic but FYI.

Thanks @adam-smnk  - Yes it seems to do similar. Non need for this then. thanks. will close it.


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


More information about the Mlir-commits mailing list