From: Mehdi Amini Date: Fri, 19 Feb 2021 01:53:14 +0000 (+0000) Subject: Fix MLIR Toy tutorial JIT example and add a test to cover it X-Git-Tag: llvmorg-14-init~14670 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae15b1e7ad71e4bfde1b031dd5e6b0bbb3b88a42;p=platform%2Fupstream%2Fllvm.git Fix MLIR Toy tutorial JIT example and add a test to cover it --- diff --git a/mlir/examples/toy/Ch6/toyc.cpp b/mlir/examples/toy/Ch6/toyc.cpp index 5298c0b..0645bd4 100644 --- a/mlir/examples/toy/Ch6/toyc.cpp +++ b/mlir/examples/toy/Ch6/toyc.cpp @@ -240,7 +240,7 @@ int runJit(mlir::ModuleOp module) { auto &engine = maybeEngine.get(); // Invoke the JIT-compiled function. - auto invocationResult = engine->invoke("main"); + auto invocationResult = engine->invokePacked("main"); if (invocationResult) { llvm::errs() << "JIT invocation failed\n"; return -1; diff --git a/mlir/examples/toy/Ch7/toyc.cpp b/mlir/examples/toy/Ch7/toyc.cpp index 8bace4a..0f6d387 100644 --- a/mlir/examples/toy/Ch7/toyc.cpp +++ b/mlir/examples/toy/Ch7/toyc.cpp @@ -241,7 +241,7 @@ int runJit(mlir::ModuleOp module) { auto &engine = maybeEngine.get(); // Invoke the JIT-compiled function. - auto invocationResult = engine->invoke("main"); + auto invocationResult = engine->invokePacked("main"); if (invocationResult) { llvm::errs() << "JIT invocation failed\n"; return -1; diff --git a/mlir/test/Examples/Toy/Ch6/jit.toy b/mlir/test/Examples/Toy/Ch6/jit.toy new file mode 100644 index 0000000..250eb4e --- /dev/null +++ b/mlir/test/Examples/Toy/Ch6/jit.toy @@ -0,0 +1,5 @@ +# RUN: toyc-ch6 -emit=jit %s + +def main() { + print([[1, 2], [3, 4]]); +} diff --git a/mlir/test/Examples/Toy/Ch7/jit.toy b/mlir/test/Examples/Toy/Ch7/jit.toy new file mode 100644 index 0000000..aaa898f --- /dev/null +++ b/mlir/test/Examples/Toy/Ch7/jit.toy @@ -0,0 +1,5 @@ +# RUN: toyc-ch7 -emit=jit %s + +def main() { + print([[1, 2], [3, 4]]); +}