You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an attempt to work around #29, I tried separating I/O code (i.e. main()) and computation code (arbitrary non-main function). However I could not find a way for sdfg-opt to run over a non-main function.
I am trying to get sdfg-opt to run over this main.s MLIR code.
Problems
1. The command line flag syntax is not immediately obvious
Note: I understand this is more an issue from MLIR's side, so I'll just leave some notes as a reference for future readers.
sdfg-opt --help shows something useful, but only partially:
Compiler passes to run
Passes:
--convert-to-sdfg - Convert SCF, Arith, Math and Memref dialect to SDFG dialect
--main-func-name=<string> - Specify which func should be seen as the main func
--linalg-to-sdfg - Convert Linalg dialect to SDFG dialect
--lower-sdfg - Convert SDFG dialect to Func, CF, Memref and SCF dialects
It took me a good while to figure out that the only recognized syntax is:
With the above command, this is all the output I get:
module {
}
I could not find any command line that would make sdfg-opt emit converted MLIR in sdfg dialect. The only way to make it work is to rename func.func @example into func.func @main.
Moreover, if the function is @main, then sdfg-opt works properly regardless of what the CLI argument value to main-func-name is (even garbage). For example:
It seems like main-func-name is completely disregarded.
Utility
If main-func-name is fixed, then I can selectively run sdfg-opt through computation code while having separate facilities for handling I/O, enabling me to work around #29.
The text was updated successfully, but these errors were encountered:
Thanks for the comprehensive issue!
Indeed the main-func-name flag is a work in progress and currently ignored.
I will implement it as soon as possible.
In an attempt to work around #29, I tried separating I/O code (i.e.
main()
) and computation code (arbitrary non-main
function). However I could not find a way forsdfg-opt
to run over a non-main
function.Steps
I started with this
example.c
:I compile this C into MLIR with Polygeist:
The resulting
main.s
has the following content:I am trying to get
sdfg-opt
to run over thismain.s
MLIR code.Problems
1. The command line flag syntax is not immediately obvious
sdfg-opt --help
shows something useful, but only partially:It took me a good while to figure out that the only recognized syntax is:
2. The
main-func-name
argument isn't respectedWith the above command, this is all the output I get:
I could not find any command line that would make
sdfg-opt
emit converted MLIR insdfg
dialect. The only way to make it work is to renamefunc.func @example
intofunc.func @main
.Moreover, if the function is
@main
, thensdfg-opt
works properly regardless of what the CLI argument value tomain-func-name
is (even garbage). For example:sdfg-opt --convert-to-sdfg=main-func-name="@#$^&*" main.s
It seems like
main-func-name
is completely disregarded.Utility
If
main-func-name
is fixed, then I can selectively runsdfg-opt
through computation code while having separate facilities for handling I/O, enabling me to work around #29.The text was updated successfully, but these errors were encountered: