Skip to content

Register allocation panic with simd comparison #3951

@alexcrichton

Description

@alexcrichton

A fuzz bug came in over the weekend and bisection points to #3886 as the cause. This wasm module:

(module
  (func (result v128)
    global.get 0
    global.get 0
    i8x16.gt_u
  )
  (global (mut v128) v128.const i64x2 0 0)
)

fails with:

$ cargo run -q compile testcase0.wat
 ERROR cranelift_codegen::machinst::compile > Register allocation error for vcode
VCode_ShowWithRRU {{
  Entry block: 0
Block 0:
  (original IR block: block0)
  (successor: Block 1)
  (instruction range: 0 .. 12)
  Inst 0:   movq    %rdi, %v0J
  Inst 1:   movq    %rsi, %v1J
  Inst 2:   movups  64(%v0J), %v2V
  Inst 3:   movdqa  %v2V, %v7V
  Inst 4:   pmaxub  64(%v0J), %v7V
  Inst 5:   movdqa  %v7V, %v8V
  Inst 6:   pcmpeqb %v3V, %v8V
  Inst 7:   pcmpeqd %v9V, %v9V
  Inst 8:   movdqa  %v8V, %v4V
  Inst 9:   pxor    %v9V, %v4V
  Inst 10:   movdqa  %v4V, %v5V
  Inst 11:   jmp     label1
Block 1:
  (original IR block: block1)
  (instruction range: 12 .. 15)
  Inst 12:   movdqa  %v5V, %v6V
  Inst 13:   movdqa  %v6V, %xmm0
  Inst 14:   ret
}}

Error: Analysis(EntryLiveinValues([v3V]))
thread 'main' panicked at 'register allocation: Analysis(EntryLiveinValues([v3V]))', cranelift/codegen/src/machinst/compile.rs:98:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The non-minimized reproduction is here

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions