No dialect specification in generated MLIR
The generated MLIR does not have dialect specification. For example, tests/test_builder.py generates instructions without dialect (as shown below):
func -> should be -> func.func constant -> should be -> arith.constant
This causes issues when I use this output with llvm tools (mlir-opt or mlir-translate). They complain about not recognizing "func" or "constant".
module {
func @saxpy(%_pymlir_fnarg: f64, %_pymlir_fnarg_0: memref<?xf64>, %_pymlir_fnarg_1: memref<?xf64>) {
%_pymlir_ssa = constant 0 : index
%_pymlir_ssa_0 = dim %_pymlir_fnarg_0 , %_pymlir_ssa : index
affine.for %_pymlir_i = 0 to %_pymlir_ssa_0 {
%_pymlir_ssa_1 = affine.load %_pymlir_fnarg_0 [ (%_pymlir_i) ] : memref<?xf64>
%_pymlir_ssa_2 = mulf %_pymlir_ssa_1 , %_pymlir_fnarg : f64
%_pymlir_ssa_3 = affine.load %_pymlir_fnarg_1 [ (%_pymlir_i) ] : memref<?xf64>
%_pymlir_ssa_4 = addf %_pymlir_ssa_3 , %_pymlir_ssa_2 : f64
affine.store %_pymlir_ssa_4 , %_pymlir_fnarg_1 [ (%_pymlir_i) ] : memref<?xf64>
}
return
}
}
See #19 and #20 for func. constant seems like a similar issue
Yes, the recent changes to MLIR requires us to add the concept of core/standard dialects. This is in progress for func, and will be done for the rest as well. I have a bit of high overhead at the moment so I will not be able to make the necessary changes very soon. Any PRs are welcome!