module {
func @top(%arg0: memref<10xi32>) attributes {extra_itypes = "s", extra_otypes = ""} {
%0 = hcl.create_loop_handle "loop_0" : !hcl.LoopHandle
affine.for %arg1 = 0 to 10 {
%1 = builtin.unrealized_conversion_cast %arg1 : index to i32
%2 = builtin.unrealized_conversion_cast %arg1 : index to index
affine.store %1, %arg0[%arg1] {to = "compute_0"} : memref<10xi32>
} {loop_name = "loop_0"}
return
}
}
Two unrealized_conversion_cast are generated but they should not be there, since i32 and index are builtin types that are supported by builtin cast operations.
The following imperative program
will generate the MLIR code as follows.
Two
unrealized_conversion_cast
are generated but they should not be there, sincei32
andindex
are builtin types that are supported by builtin cast operations.