This patch fixes crash when attempting to convert uint to int address space during finalize-memref-to-llvm by doing the following: 1. Add a check to verify that IntegerAttr is signed int before calling IntegerAttr::getInt() 2. Emit error when getMemRefAddressSpace returns a failure() Closes #111242 --------- Co-authored-by: Christian Ulmann <christianulmann@gmail.com>
9 lines
385 B
MLIR
9 lines
385 B
MLIR
// RUN: mlir-opt %s -finalize-memref-to-llvm -verify-diagnostics
|
|
|
|
// CHECK-LABEL: @invalid_int_conversion
|
|
func.func @invalid_int_conversion() {
|
|
// expected-error@+1 {{conversion of memref memory space 1 : ui64 to integer address space failed. Consider adding memory space conversions.}}
|
|
%alloc = memref.alloc() {alignment = 64 : i64} : memref<10xf32, 1 : ui64>
|
|
return
|
|
}
|