peterdelevoryas opened Issue #1383:
Thanks for opening a bug report on Cranelift! Please answer the questions below
if they're relevant and delete this text before submitting.
- My cranelift frontend is generating the following IL, and
module.define_function(...)
is failing with the "ghost value used by real instruction", which seems like maybe register allocation skipped over theineg
result??function u0:0(i32, i64) -> i32 system_v { gv0 = symbol colocated u1:0 sig0 = (i64, i64, i64, i64) -> i32 system_v fn0 = u0:1 sig0 block0(v0: i32, v1: i64): v2 = iconst.i32 1 v3 = ineg v2 return v3 } error defining function "main": Compilation( Verifier( VerifierErrors( [ VerifierError { location: inst2, context: None, message: "v3 is a ghost value used by a real [Op1ret#c3] instruction", }, ], ), ), )
- I guess I thought ineg could be used on scalar registers, but I only see simd filetests using it?
cranelift = "0.58.0"
- This is on Mac OS, using rust 1.41.0. I'm generating object files using the
cranelift-faerie
integration
peterdelevoryas labeled Issue #1383:
Thanks for opening a bug report on Cranelift! Please answer the questions below
if they're relevant and delete this text before submitting.
- My cranelift frontend is generating the following IL, and
module.define_function(...)
is failing with the "ghost value used by real instruction", which seems like maybe register allocation skipped over theineg
result??function u0:0(i32, i64) -> i32 system_v { gv0 = symbol colocated u1:0 sig0 = (i64, i64, i64, i64) -> i32 system_v fn0 = u0:1 sig0 block0(v0: i32, v1: i64): v2 = iconst.i32 1 v3 = ineg v2 return v3 } error defining function "main": Compilation( Verifier( VerifierErrors( [ VerifierError { location: inst2, context: None, message: "v3 is a ghost value used by a real [Op1ret#c3] instruction", }, ], ), ), )
- I guess I thought ineg could be used on scalar registers, but I only see simd filetests using it?
cranelift = "0.58.0"
- This is on Mac OS, using rust 1.41.0. I'm generating object files using the
cranelift-faerie
integration
peterdelevoryas commented on Issue #1383:
Oh also, this isn't really a big deal, cause I guess you can always just construct an equivalent
isub 0, v2
instruction or something
bnjbvr commented on Issue #1383:
Hi! Thanks for opening an issue. Indeed, that's what the legalization in cranelift-codegen/src/isa/x86/enc_tables.rs does in
convert_ineg
. It could and should be done for non-vector types too. This is a good bug to learn about manipulating Cranelift's IR, if somebody wants to chime in!
bnjbvr labeled Issue #1383:
Thanks for opening a bug report on Cranelift! Please answer the questions below
if they're relevant and delete this text before submitting.
- My cranelift frontend is generating the following IL, and
module.define_function(...)
is failing with the "ghost value used by real instruction", which seems like maybe register allocation skipped over theineg
result??function u0:0(i32, i64) -> i32 system_v { gv0 = symbol colocated u1:0 sig0 = (i64, i64, i64, i64) -> i32 system_v fn0 = u0:1 sig0 block0(v0: i32, v1: i64): v2 = iconst.i32 1 v3 = ineg v2 return v3 } error defining function "main": Compilation( Verifier( VerifierErrors( [ VerifierError { location: inst2, context: None, message: "v3 is a ghost value used by a real [Op1ret#c3] instruction", }, ], ), ), )
- I guess I thought ineg could be used on scalar registers, but I only see simd filetests using it?
cranelift = "0.58.0"
- This is on Mac OS, using rust 1.41.0. I'm generating object files using the
cranelift-faerie
integration
peterdelevoryas commented on Issue #1383:
Hey I really appreciate the quick response! I looked into making the change: unfortunately, when I added a case in
convert_ineg
for scalar integer types, it doesn't seem to actually run. It seems like this legalization function is only applied to SIMD types: is there something somewhere that specifies that? I was unable to find it. I mean, something outside ofconvert_ineg
. I am aware the the current implementation ofconvert_ineg
only applies the transformation on int vector types. But I'm wondering if there's something _outside_ ofconvert_ineg
that makes it only run on SIMD types.
bjorn3 commented on Issue #1383:
convert_neg is called from https://github.com/bytecodealliance/cranelift/blob/98c818c129979e98a3db150f8f9698f6451b7ef7/cranelift-codegen/meta/src/isa/x86/legalize.rs#L612. Adding copies of that line with
widen
andexpand
instead ofnarrow
may work. Please also add a test for bothi8
/i16
(widen) andi32
/i64
(expand).
abrown closed Issue #1383:
Thanks for opening a bug report on Cranelift! Please answer the questions below
if they're relevant and delete this text before submitting.
- My cranelift frontend is generating the following IL, and
module.define_function(...)
is failing with the "ghost value used by real instruction", which seems like maybe register allocation skipped over theineg
result??function u0:0(i32, i64) -> i32 system_v { gv0 = symbol colocated u1:0 sig0 = (i64, i64, i64, i64) -> i32 system_v fn0 = u0:1 sig0 block0(v0: i32, v1: i64): v2 = iconst.i32 1 v3 = ineg v2 return v3 } error defining function "main": Compilation( Verifier( VerifierErrors( [ VerifierError { location: inst2, context: None, message: "v3 is a ghost value used by a real [Op1ret#c3] instruction", }, ], ), ), )
- I guess I thought ineg could be used on scalar registers, but I only see simd filetests using it?
cranelift = "0.58.0"
- This is on Mac OS, using rust 1.41.0. I'm generating object files using the
cranelift-faerie
integration
Last updated: Nov 22 2024 at 16:03 UTC