This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #loc1 = loc("/home/stella/src/iree-samples/pydm/simple/fibonacci.py":31:0) | |
| #loc19 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":16:0) | |
| #loc31 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":27:0) | |
| module @module { | |
| func @main(%arg0: i32 loc("/home/stella/src/iree-samples/pydm/simple/fibonacci.py":31:0)) -> (i32, i32) { | |
| %c-4_i32 = arith.constant -4 : i32 loc(#loc2) | |
| %c-7_i32 = arith.constant -7 : i32 loc(#loc3) | |
| %c3_i32 = arith.constant 3 : i32 loc(#loc4) | |
| %c0_i32 = arith.constant 0 : i32 loc(#loc5) | |
| %c1 = arith.constant 1 : index loc(#loc1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #loc1 = loc("/home/stella/src/iree-samples/pydm/simple/lists.py":40:0) | |
| module @module { | |
| func @main(%arg0: i32 loc("/home/stella/src/iree-samples/pydm/simple/lists.py":40:0), %arg1: i32 loc("/home/stella/src/iree-samples/pydm/simple/lists.py":40:0)) -> (i32, i32) { | |
| %c-4_i32 = arith.constant -4 : i32 loc(#loc2) | |
| %c-7_i32 = arith.constant -7 : i32 loc(#loc3) | |
| %c0_i32 = arith.constant 0 : i32 loc(#loc3) | |
| %c-1_i32 = arith.constant -1 : i32 loc(#loc4) | |
| %c2 = arith.constant 2 : index loc(#loc1) | |
| %c1 = arith.constant 1 : index loc(#loc1) | |
| %c0 = arith.constant 0 : index loc(#loc1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module @module { | |
| iree_pydm.func @main(%arg0: !iree_pydm.integer) -> (!iree_pydm.exception_result, !iree_pydm.integer) attributes {arg_names = ["n"], cell_vars = [], free_vars = ["n", "a", "b", "i", "c"]} { | |
| %i = alloc_free_var "i" -> !iree_pydm.free_var_ref | |
| %b = alloc_free_var "b" -> !iree_pydm.free_var_ref | |
| %a = alloc_free_var "a" -> !iree_pydm.free_var_ref | |
| %c = alloc_free_var "c" -> !iree_pydm.free_var_ref | |
| %n = alloc_free_var "n" -> !iree_pydm.free_var_ref | |
| %0 = box %arg0 : !iree_pydm.integer -> !iree_pydm.object<!iree_pydm.integer> | |
| store_var %n = %0 : !iree_pydm.free_var_ref, !iree_pydm.object<!iree_pydm.integer> | |
| %1 = constant 0 : i64 -> !iree_pydm.integer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module @module { | |
| func @main(%arg0: i32 loc("/home/stella/src/iree-samples/pydm/simple/fibonacci.py":44:0)) -> (i32, i32) { | |
| %c-4_i32 = arith.constant -4 : i32 loc(#loc2) | |
| %c0_i32 = arith.constant 0 : i32 loc(#loc2) | |
| %c1 = arith.constant 1 : index loc(#loc1) | |
| %c78_i32 = arith.constant 78 : i32 loc(#loc1) | |
| %c0 = arith.constant 0 : index loc(#loc1) | |
| %c2 = arith.constant 2 : index loc(#loc1) | |
| %c256_i32 = arith.constant 256 : i32 loc(#loc1) | |
| %c1_i32 = arith.constant 1 : i32 loc(#loc3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run --rm -it -v $(pwd):/work ubuntu:18.04 /bin/bash | |
| In container history: | |
| 2 apt update | |
| 4 apt search clang | |
| 5 apt install clang | |
| 7 apt install python3 | |
| 12 apt install python3-pip | |
| 13 python3 -m pip install cmake==3.21.3 | |
| 14 python3 -m pip install ninja |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #loc1 = loc("/home/stella/src/iree-samples/pydm/simple/arithmetic.py":28:0) | |
| #loc12 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":16:0) | |
| #loc30 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":27:0) | |
| #loc88 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":62:0) | |
| #loc146 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":97:0) | |
| #loc204 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/booleans.py":16:0) | |
| module @module { | |
| func @main(%arg0: i32 loc("/home/stella/src/iree-samples/pydm/simple/arithmetic.py":28:0), %arg1: i32 loc("/home/stella/src/iree-samples/pydm/simple/arithmetic.py":28:0), %arg2: i32 loc("/home/stella/src/iree-samples/pydm/simple/arithmetic.py":28:0)) -> (i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module @module { | |
| func @object_as_bool_int(%arg0: i32, %arg1: i32, %arg2: i32) -> (i32, i32) { | |
| %c-4_i32 = constant -4 : i32 | |
| %c0_i32 = constant 0 : i32 | |
| %c1 = constant 1 : index | |
| %c256_i32 = constant 256 : i32 | |
| %c0 = constant 0 : index | |
| %c2 = constant 2 : index | |
| %c78_i32 = constant 78 : i32 | |
| %0 = iree.list.create : !iree.list<!iree.variant> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CALL -> return_arg | |
| DISPATCH 1 ConstI32Zero | |
| DISPATCH 4 ConstI32 | |
| DISPATCH 11 ConstI32 | |
| DISPATCH 18 ConstI32 | |
| DISPATCH 25 ConstI32 | |
| DISPATCH 32 ConstI32 | |
| DISPATCH 39 ConstI32 | |
| DISPATCH 47 ConstF32Zero | |
| DISPATCH 50 ConstI32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #loc1 = loc("basic_sample.py":13:0) | |
| #loc6 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/booleans.py":16:0) | |
| module @module { | |
| func @return_arg(%arg0: i32 loc("basic_sample.py":13:0), %arg1: i32 loc("basic_sample.py":13:0), %arg2: i32 loc("basic_sample.py":13:0)) -> (i32, i32) { | |
| %0 = iree.list.create : !iree.list<!iree.variant> loc(#loc1) | |
| %1 = iree.list.create : !iree.list<!iree.variant> loc(#loc1) | |
| %2 = iree.list.create : !iree.list<!iree.variant> loc(#loc1) | |
| %3 = iree.list.create : !iree.list<!iree.variant> loc(#loc1) | |
| %c2 = constant 2 : index loc(#loc1) | |
| iree.list.resize %3, %c2 : !iree.list<!iree.variant> loc(#loc1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ./iree/tools/iree-translate --iree-hal-target-backends=cpu --iree-mlir-to-vm-bytecode-module ~/scratch/ireerepro.mlir > ~/scratch/returnif.vmfb | |
| // | |
| // @M.export_pyfunc | |
| // def return_arg(a: int, b: int, c: int) -> int: | |
| // if b: | |
| // return a | |
| // else: | |
| // return c | |
| // Should print (0, 1) but prints (0, 5) |