JohnDowson opened issue #3559:
.clif
Test Casefunction u0:0(r64, r64) system_v { ss0 = explicit_slot 31 ss1 = explicit_slot 16 ss2 = explicit_slot 16 ss3 = explicit_slot 16 sig0 = (r64, r64, r64) system_v fn0 = u0:0 sig0 block0(v0: r64, v1: r64): v19 -> v0 v2 = iconst.i64 0 v3 = stack_addr.r64 ss0 v4 = stack_addr.r64 ss1 v5 = iconst.i64 10 v6 = iconst.i64 1 store aligned v6, v4 store aligned v5, v4+8 call fn0(v3, v1, v4) v8 = load.i64 aligned v3+8 brz v8, block2 jump block1 block1: v9 = iconst.i64 0 v10 = stack_addr.r64 ss2 v11 = iconst.i64 1 v12 = iconst.i64 1 store aligned v12, v10 store aligned v11, v10+8 jump block3(v10) block2: v13 = iconst.i64 0 v14 = stack_addr.r64 ss3 v15 = iconst.i64 2 v16 = iconst.i64 1 store aligned v16, v14 store aligned v15, v14+8 jump block3(v14) block3(v7: f64): v17 = load.i64 aligned v7 v18 = load.i64 aligned v7+8 store aligned v17, v0 store aligned v18, v0+8 return }
Steps to Reproduce
- Clone https://github.com/JohnDowson/CraneLisp branch struct-values
- Run
cargo run -- -c ifjit.crl
Expected Results
I expect function to compile, or the process to produce an informative error.
Actual Results
thread 'main' panicked at 'function must be compiled before it can be finalized', /home/johnd/.cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-jit-0.78.0/src/backend.rs:356:14
Versions and Environment
Cranelift version or commit: 0.78.0
Operating system: Arch Linux kernel 5.15.4-arch1-1
Architecture: x86-64
Extra Info
Note that in this case the function is recursive. I suspect that there is something wrong with how I translate if condition, since non-recursive calls without if condition work, but break when wrapped in an if. However, after consulting with @bjorn3 i've been compelled to file this as a bug report.
For reference, here is the translation function for if: https://github.com/JohnDowson/CraneLisp/blob/struct-values/src/jit.rs#L367-L397
JohnDowson labeled issue #3559:
.clif
Test Casefunction u0:0(r64, r64) system_v { ss0 = explicit_slot 31 ss1 = explicit_slot 16 ss2 = explicit_slot 16 ss3 = explicit_slot 16 sig0 = (r64, r64, r64) system_v fn0 = u0:0 sig0 block0(v0: r64, v1: r64): v19 -> v0 v2 = iconst.i64 0 v3 = stack_addr.r64 ss0 v4 = stack_addr.r64 ss1 v5 = iconst.i64 10 v6 = iconst.i64 1 store aligned v6, v4 store aligned v5, v4+8 call fn0(v3, v1, v4) v8 = load.i64 aligned v3+8 brz v8, block2 jump block1 block1: v9 = iconst.i64 0 v10 = stack_addr.r64 ss2 v11 = iconst.i64 1 v12 = iconst.i64 1 store aligned v12, v10 store aligned v11, v10+8 jump block3(v10) block2: v13 = iconst.i64 0 v14 = stack_addr.r64 ss3 v15 = iconst.i64 2 v16 = iconst.i64 1 store aligned v16, v14 store aligned v15, v14+8 jump block3(v14) block3(v7: f64): v17 = load.i64 aligned v7 v18 = load.i64 aligned v7+8 store aligned v17, v0 store aligned v18, v0+8 return }
Steps to Reproduce
- Clone https://github.com/JohnDowson/CraneLisp branch struct-values
- Run
cargo run -- -c ifjit.crl
Expected Results
I expect function to compile, or the process to produce an informative error.
Actual Results
thread 'main' panicked at 'function must be compiled before it can be finalized', /home/johnd/.cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-jit-0.78.0/src/backend.rs:356:14
Versions and Environment
Cranelift version or commit: 0.78.0
Operating system: Arch Linux kernel 5.15.4-arch1-1
Architecture: x86-64
Extra Info
Note that in this case the function is recursive. I suspect that there is something wrong with how I translate if condition, since non-recursive calls without if condition work, but break when wrapped in an if. However, after consulting with @bjorn3 i've been compelled to file this as a bug report.
For reference, here is the translation function for if: https://github.com/JohnDowson/CraneLisp/blob/struct-values/src/jit.rs#L367-L397
JohnDowson labeled issue #3559:
.clif
Test Casefunction u0:0(r64, r64) system_v { ss0 = explicit_slot 31 ss1 = explicit_slot 16 ss2 = explicit_slot 16 ss3 = explicit_slot 16 sig0 = (r64, r64, r64) system_v fn0 = u0:0 sig0 block0(v0: r64, v1: r64): v19 -> v0 v2 = iconst.i64 0 v3 = stack_addr.r64 ss0 v4 = stack_addr.r64 ss1 v5 = iconst.i64 10 v6 = iconst.i64 1 store aligned v6, v4 store aligned v5, v4+8 call fn0(v3, v1, v4) v8 = load.i64 aligned v3+8 brz v8, block2 jump block1 block1: v9 = iconst.i64 0 v10 = stack_addr.r64 ss2 v11 = iconst.i64 1 v12 = iconst.i64 1 store aligned v12, v10 store aligned v11, v10+8 jump block3(v10) block2: v13 = iconst.i64 0 v14 = stack_addr.r64 ss3 v15 = iconst.i64 2 v16 = iconst.i64 1 store aligned v16, v14 store aligned v15, v14+8 jump block3(v14) block3(v7: f64): v17 = load.i64 aligned v7 v18 = load.i64 aligned v7+8 store aligned v17, v0 store aligned v18, v0+8 return }
Steps to Reproduce
- Clone https://github.com/JohnDowson/CraneLisp branch struct-values
- Run
cargo run -- -c ifjit.crl
Expected Results
I expect function to compile, or the process to produce an informative error.
Actual Results
thread 'main' panicked at 'function must be compiled before it can be finalized', /home/johnd/.cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-jit-0.78.0/src/backend.rs:356:14
Versions and Environment
Cranelift version or commit: 0.78.0
Operating system: Arch Linux kernel 5.15.4-arch1-1
Architecture: x86-64
Extra Info
Note that in this case the function is recursive. I suspect that there is something wrong with how I translate if condition, since non-recursive calls without if condition work, but break when wrapped in an if. However, after consulting with @bjorn3 i've been compelled to file this as a bug report.
For reference, here is the translation function for if: https://github.com/JohnDowson/CraneLisp/blob/struct-values/src/jit.rs#L367-L397
JohnDowson closed issue #3559:
.clif
Test Casefunction u0:0(r64, r64) system_v { ss0 = explicit_slot 31 ss1 = explicit_slot 16 ss2 = explicit_slot 16 ss3 = explicit_slot 16 sig0 = (r64, r64, r64) system_v fn0 = u0:0 sig0 block0(v0: r64, v1: r64): v19 -> v0 v2 = iconst.i64 0 v3 = stack_addr.r64 ss0 v4 = stack_addr.r64 ss1 v5 = iconst.i64 10 v6 = iconst.i64 1 store aligned v6, v4 store aligned v5, v4+8 call fn0(v3, v1, v4) v8 = load.i64 aligned v3+8 brz v8, block2 jump block1 block1: v9 = iconst.i64 0 v10 = stack_addr.r64 ss2 v11 = iconst.i64 1 v12 = iconst.i64 1 store aligned v12, v10 store aligned v11, v10+8 jump block3(v10) block2: v13 = iconst.i64 0 v14 = stack_addr.r64 ss3 v15 = iconst.i64 2 v16 = iconst.i64 1 store aligned v16, v14 store aligned v15, v14+8 jump block3(v14) block3(v7: f64): v17 = load.i64 aligned v7 v18 = load.i64 aligned v7+8 store aligned v17, v0 store aligned v18, v0+8 return }
Steps to Reproduce
- Clone https://github.com/JohnDowson/CraneLisp branch struct-values
- Run
cargo run -- -c ifjit.crl
Expected Results
I expect function to compile, or the process to produce an informative error.
Actual Results
thread 'main' panicked at 'function must be compiled before it can be finalized', /home/johnd/.cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-jit-0.78.0/src/backend.rs:356:14
Versions and Environment
Cranelift version or commit: 0.78.0
Operating system: Arch Linux kernel 5.15.4-arch1-1
Architecture: x86-64
Extra Info
Note that in this case the function is recursive. I suspect that there is something wrong with how I translate if condition, since non-recursive calls without if condition work, but break when wrapped in an if. However, after consulting with @bjorn3 i've been compelled to file this as a bug report.
For reference, here is the translation function for if: https://github.com/JohnDowson/CraneLisp/blob/struct-values/src/jit.rs#L367-L397
Last updated: Nov 22 2024 at 17:03 UTC