Skip to content

Bug in the VectorEmulateNarrowType logic #115742

@banach-space

Description

@banach-space

Reproducer

func.func @vector_maskedload_i4_constant_mask(%passthru: vector<8xi4>) -> vector<8xi4> {
  %0 = memref.alloc() : memref<3x8xi4>
  %cst = arith.constant dense<0> : vector<8xi4>
  %mask = arith.constant dense<[false, true, true, true, true, false, false, false]> : vector<8xi1>
  %c0 = arith.constant 0 : index
  %1 = vector.maskedload %0[%c0, %c0], %mask, %passthru :
    memref<3x8xi4>, vector<8xi1>, vector<8xi4> into vector<8xi4>
  return %1 : vector<8xi4>
}

To run

mlir-opt --test-emulate-narrow-int="arith-compute-bitwidth=1 memref-load-bitwidth=8" --cse --split-input-file

Error

ATM, this example will trigger an infinite loop due to this while cond not supporting arith.constant. Once that's fixed, I get this error:

file.mlir:1 offset :8:8: error: failed to legalize operation 'vector.maskedload' that was explicitly marked illegal
  %1 = vector.maskedload %0[%c0, %c0], %mask, %passthru :
       ^

CC @lialan

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions