Open Kmeakin opened 3 months ago
-1
in clif ir text files is -1i64
, which is the same as u64::MAX
. Cranelift used to ignore the upper half of the immediate, but was changed to expect the upper half to be zeroed. We didn't yet change imm64 to uimm64 yet though, so immediates are still represented as signed integers, despite unsigned integers effectively being expected by the backend.
Adding this optimization to
codegen/src/opts/icmp.isle
Triggers a verification error when optimizing
filetests/filetests/egraph/icmp-parameterized.clif
:I suspect somewhere the immediate is being sign extended when it should be zero extended