[Mlir-commits] [mlir] f8c1f3b - Revert "Revert "Fix MLIR Toy tutorial JIT example and add a test to cover it""
Mehdi Amini
llvmlistbot at llvm.org
Fri Feb 19 15:55:13 PST 2021
Author: Mehdi Amini
Date: 2021-02-19T23:54:52Z
New Revision: f8c1f3b14ad988fd786b896b4b342606bdc760cf
URL: https://github.com/llvm/llvm-project/commit/f8c1f3b14ad988fd786b896b4b342606bdc760cf
DIFF: https://github.com/llvm/llvm-project/commit/f8c1f3b14ad988fd786b896b4b342606bdc760cf.diff
LOG: Revert "Revert "Fix MLIR Toy tutorial JIT example and add a test to cover it""
This reverts commit f36060417ad3e247900dfcb07a2476a9d92ee2d2 and
reapply commit ae15b1e7ad71e4bfde1b031dd5e6b0bbb3b88a42.
JIT test must be annotated to not run on Windows.
Added:
mlir/test/Examples/Toy/Ch6/jit.toy
mlir/test/Examples/Toy/Ch7/jit.toy
Modified:
mlir/examples/toy/Ch6/toyc.cpp
mlir/examples/toy/Ch7/toyc.cpp
Removed:
################################################################################
diff --git a/mlir/examples/toy/Ch6/toyc.cpp b/mlir/examples/toy/Ch6/toyc.cpp
index 5298c0bb5205..0645bd40c1ba 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 8bace4a73977..0f6d3876a5ad 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 000000000000..387c0450d936
--- /dev/null
+++ b/mlir/test/Examples/Toy/Ch6/jit.toy
@@ -0,0 +1,6 @@
+# RUN: toyc-ch6 -emit=jit %s
+# UNSUPPORTED: windows
+
+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 000000000000..5310031ed3cb
--- /dev/null
+++ b/mlir/test/Examples/Toy/Ch7/jit.toy
@@ -0,0 +1,6 @@
+# RUN: toyc-ch7 -emit=jit %s
+# UNSUPPORTED: windows
+
+def main() {
+ print([[1, 2], [3, 4]]);
+}
More information about the Mlir-commits
mailing list