Currently we generate a single function that takes in block arguments. In order to make it compatible with polybench code in general, we should change the codegen behaviour.
The workflow should work as follows:
The input MLIR code should contain a @main function that acts as the entry point. It should also have a set of affine functions that should be optimised by polymer-opt.
Given the names of the entry point and the affine functions to be transformed (should be passed as command-line args), polymer-opt optimises all the given affine functions and replaces the function call to them by the optimised versions.
We can then perform some post optimisation and lower it down to LLVM.
For example, command like this should work properly:
# In the build/ directory
./bin/polymer-opt ../test/polymer-opt/PlutoTransform/matmul.mlir --pluto-opt=matmul | ../llvm/build/bin/mlir-opt --lower-affine --convert-scf-to-std --convert-std-to-llvm | ../llvm/build/bin/mlir-cpu-runner --entry-point-result=void -O3
Currently we generate a single function that takes in block arguments. In order to make it compatible with polybench code in general, we should change the codegen behaviour.
The workflow should work as follows:
@main
function that acts as the entry point. It should also have a set of affine functions that should be optimised by polymer-opt.For example, command like this should work properly:
TODO -