Files
clang-p2996/mlir/test/Conversion/MemRefToLLVM/invalid.mlir
Krzysztof Drewniak 73c6248cc2 [mlir][MemRefToLLVM] Fix crashes with unconvertable memory spaces (#70694)
Fixes #70160

The issue is resolved by:
1. Changing the call to address space conversion to use the correct
return type, preventing the code from moving past the if and into the
crashing optional dereference.
2. Adding handling to the AllocLikeOp rewriter for the case where the
underlying buffer allocation fails.
2023-10-31 09:01:43 -05:00

13 lines
517 B
MLIR

// RUN: mlir-opt %s -finalize-memref-to-llvm 2>&1 | FileCheck %s
// Since the error is at an unknown location, we use FileCheck instead of
// -veri-y-diagnostics here
// CHECK: conversion of memref memory space "foo" to integer address space failed. Consider adding memory space conversions.
// CHECK-LABEL: @bad_address_space
func.func @bad_address_space(%a: memref<2xindex, "foo">) {
%c0 = arith.constant 0 : index
// CHECK: memref.store
memref.store %c0, %a[%c0] : memref<2xindex, "foo">
return
}