Closed dcrc2 closed 2 years ago
Several tests were failing in #692 when trying to lower code using scf.for
to LLVM. This requires a preparatory pass to convert SCF to std (eqivalent to mlir-opt --convert-scf-to-std --convert-std-to-llvm
as described in users/ml/relu3.md
). Having fixed this problem, the only failing test is now build.ks
for which the expected output has changed.
Test expectations are now updated and this PR is ready.
Updated version of #692, rebasing onto
master
.Original description from #692:
This PR showcases the usage of MLIR edsc features in the lowering of a build node.
scf
dialect instead ofstd
dialect.edsc - Embedded Domain Specific Concepts
We move away from using a series of
create
calls on the builder itself, i.e. old build lowering Instead, we set up aScopedContext
once with the correct insertion point. Then we can use a much simpler declarative interface to emit new operations. new build loweringThis PR is tested to work partially with LLVM commit f4013359b3da2c78e94a64245de8638460f96c1a. e.g. lowering of maths.ks works as expected
ksc-mlir MLIR mlir/test/Programs/maths.ks
. However, due to slight changes in the MLIR format all FileCheck tests are expected to fail. Creating new FileCheck tests is eased dramatically by using generate-test-checks.py