kcvlex added the bug label to Issue #9143.
kcvlex added the cranelift label to Issue #9143.
kcvlex opened issue #9143:
.clif
Test Casetest compile target x86_64 function %fmax(i64, f32x4) -> f32x4 { block0(v0: i64, v1: f32x4): v2 = load.f32x4 v0 v3 = fmax v1, v2 return v3 } function %fmin(i64, f32x4) -> f32x4 { block0(v0: i64, v1: f32x4): v2 = load.f32x4 v0 v3 = fmin v1, v2 return v3 }
Steps to Reproduce
clif-util test ./the-above.clif
Expected Results
Successful
Actual Results
Assertion failure
thread 'worker #0' panicked at cranelift/codegen/src/machinst/lower.rs:1449:13: assertion failed: !self.inst_sunk.contains(&inst) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ERROR cranelift_filetests::concurrent > FAIL: panicked in worker #0: assertion failed: !self.inst_sunk.contains(&inst) FAIL ./fmax.clif: panicked in worker #0: assertion failed: !self.inst_sunk.contains(&inst) 1 tests Error: 1 failure
Versions and Environment
Cranelift version or commit: #2c3e64bc5de0a67963e0e34eabbb6de95ecda0ba
Operating system: Linux
Architecture: X86_64
Extra Info
I tried other similar cases and found that the test passes if there are no
load
instructions. Also, the problem doesn't occur when inserting ajump
like the one below.test compile target x86_64 function %fmax(i64, f32x4) -> f32x4 { block0(v0: i64, v1: f32x4): v2 = load.f32x4 v0 jump block1(v1, v2) block1(v3: f32x4, v4: f32x4): v5 = fmax v3, v4 return v5 }
kcvlex edited issue #9143:
.clif
Test Casetest compile target x86_64 function %fmax(i64, f32x4) -> f32x4 { block0(v0: i64, v1: f32x4): v2 = load.f32x4 v0 v3 = fmax v1, v2 return v3 } function %fmin(i64, f32x4) -> f32x4 { block0(v0: i64, v1: f32x4): v2 = load.f32x4 v0 v3 = fmin v1, v2 return v3 }
Steps to Reproduce
clif-util test ./the-above.clif
Expected Results
Successful
Actual Results
Assertion failure
thread 'worker #0' panicked at cranelift/codegen/src/machinst/lower.rs:1449:13: assertion failed: !self.inst_sunk.contains(&inst) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ERROR cranelift_filetests::concurrent > FAIL: panicked in worker #0: assertion failed: !self.inst_sunk.contains(&inst) FAIL ./fmax.clif: panicked in worker #0: assertion failed: !self.inst_sunk.contains(&inst) 1 tests Error: 1 failure
Versions and Environment
Cranelift version or commit: #2c3e64bc5de0a67963e0e34eabbb6de95ecda0ba
Operating system: Linux
Architecture: X86_64
Extra Info
I tried other similar cases and found that the test passes if there are no
load
instructions. Also, the problem doesn't occur when inserting ajump
like the one below.test compile target x86_64 function %fmax(i64, f32x4) -> f32x4 { block0(v0: i64, v1: f32x4): v2 = load.f32x4 v0 jump block1(v1, v2) block1(v3: f32x4, v4: f32x4): v5 = fmax v3, v4 return v5 }
fitzgen commented on issue #9143:
Maybe a regression from https://github.com/bytecodealliance/wasmtime/pull/9137 ? cc @alexcrichton
alexcrichton commented on issue #9143:
Bisection points to #5841, "very old" issue, continuing to investigate.
alexcrichton commented on issue #9143:
This appears to not affect wasm because wasm always loads/stores as i8x16 and the bitcast afterwards to go to f32x4 thwarts the load sinking here. Given that I think this is just a fix for clif/lowerings which makes it so this doesn't have quite as large of an impact. I'll work on fixing.
alexcrichton commented on issue #9143:
Thank you for the clear and concise bug report!
fitzgen closed issue #9143:
.clif
Test Casetest compile target x86_64 function %fmax(i64, f32x4) -> f32x4 { block0(v0: i64, v1: f32x4): v2 = load.f32x4 v0 v3 = fmax v1, v2 return v3 } function %fmin(i64, f32x4) -> f32x4 { block0(v0: i64, v1: f32x4): v2 = load.f32x4 v0 v3 = fmin v1, v2 return v3 }
Steps to Reproduce
clif-util test ./the-above.clif
Expected Results
Successful
Actual Results
Assertion failure
thread 'worker #0' panicked at cranelift/codegen/src/machinst/lower.rs:1449:13: assertion failed: !self.inst_sunk.contains(&inst) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ERROR cranelift_filetests::concurrent > FAIL: panicked in worker #0: assertion failed: !self.inst_sunk.contains(&inst) FAIL ./fmax.clif: panicked in worker #0: assertion failed: !self.inst_sunk.contains(&inst) 1 tests Error: 1 failure
Versions and Environment
Cranelift version or commit: #2c3e64bc5de0a67963e0e34eabbb6de95ecda0ba
Operating system: Linux
Architecture: X86_64
Extra Info
I tried other similar cases and found that the test passes if there are no
load
instructions. Also, the problem doesn't occur when inserting ajump
like the one below.test compile target x86_64 function %fmax(i64, f32x4) -> f32x4 { block0(v0: i64, v1: f32x4): v2 = load.f32x4 v0 jump block1(v1, v2) block1(v3: f32x4, v4: f32x4): v5 = fmax v3, v4 return v5 }
kcvlex commented on issue #9143:
Thanks for your quick fix!
Last updated: Nov 22 2024 at 17:03 UTC