Cranelift: fold redundant jumps causes new test failures
Categories
(Core :: JavaScript: WebAssembly, defect, P1)
Tracking
()
People
(Reporter: bbouvier, Assigned: sstangl)
References
Details
Attachments
(1 file)
|
5.93 KB,
application/octet-stream
|
Details |
I've found new test failures when compiling with Cranelift (jit_tests.py --args=--wasm-compiler=cranelift ./dist/bin/js wasm), and bisection lead to this Cranelift patch:
https://github.com/CraneStation/cranelift/commit/57fa45c8520110ee7e9b216538f1990376aed0e9
New test failures caused by this patch:
wasm/bench/wasm_box2d.js
wasm/regress/baseline-stack-height.js
wasm/spec/loop.wast.js
Sean, can you have a look, please? I've extracted the CLIF from the second one for you, and attached it to this bug. (It fails with standalone Cranelift, when running cargo run compile -d /tmp/a.clif.)
Updated•6 years ago
|
Comment 1•6 years ago
|
||
After updating to CL tip this morning, I see failures like this on the embenchen test cases I am working with:
- inst679: uses value arg from non-dominating ebb7
- inst662: v233 is defined by ebb10 which is not in the layout
Might they be caused by this bug?
| Assignee | ||
Comment 2•6 years ago
|
||
Yeah, that's caused by this bug. Here's a reduced test-case that makes the error super obvious:
set opt_level=best
target x86_64
function u0:0() {
ebb0:
v1 = iconst.i32 0
jump ebb1(v1)
ebb1(v2: i32):
jump ebb2
ebb2:
brnz v2, ebb3
jump ebb3
ebb3:
return
}
| Assignee | ||
Comment 3•6 years ago
|
||
Filed a temporary workaround pull request: https://github.com/CraneStation/cranelift/pull/914
Comment 4•6 years ago
|
||
I guess one solution might be to alias v2 to v1 in ebb0. However, I am not sure how this would interact with diversions.
| Reporter | ||
Comment 5•6 years ago
|
||
This was fixed by one of the recent Cranelift bumps, which included a Github commit reverting this change; also Sean made a simpler pass that works fine, iirc.
Description
•