llvm-project
c717ae1a - [mlir][bufferization] Refuse an incompatible default cast, not assert (#245373)

Commit
4 days ago
[mlir][bufferization] Refuse an incompatible default cast, not assert (#245373) The `bufferization` dialect's `defaultCreateCast` currently `assert`s that both types of a buffer cast are `memref`s and that they are compatible. This change turns that assertion into a failure, which callers report as a diagnostic. Also introduces a fallible `bufferization::castBuffer` utility to centralize that behavior. Add new tests for incompatible cast diagnostics, and a test that the `to_buffer(to_tensor)` fold leaves a non-`memref` pair in place. Assisted-by: Claude --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Author
Parents
Loading