Files
clang-p2996/mlir/test/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation/misc-other.mlir
McCowan Zhang a159b36724 Bufferization with ControlFlow Asserts (#95868)
Fixed incorrect bufferization interaction with cf.assert
- reordered bufferization condition checking
- fixed hasNeitherAllocateNorFreeSideEffect checking bug
- implemented memory interface for cf.assert

---------

Co-authored-by: McCowan Zhang <mccowan.z@ssi.samsung.com>
2024-06-26 08:00:39 +02:00

13 lines
515 B
MLIR

// RUN: mlir-opt -verify-diagnostics -ownership-based-buffer-deallocation -split-input-file %s
// Test Case: ownership-based-buffer-deallocation should not fail
// with cf.assert op
// CHECK-LABEL: func @func_with_assert(
// CHECK: %0 = arith.cmpi slt, %arg0, %arg1 : index
// CHECK: cf.assert %0, "%arg0 must be less than %arg1"
func.func @func_with_assert(%arg0: index, %arg1: index) {
%0 = arith.cmpi slt, %arg0, %arg1 : index
cf.assert %0, "%arg0 must be less than %arg1"
return
}