llvm-project/mlir/test/mlir-cpu-runner
Alex Zinenko 6323065fd6 [mlir] support returning unranked memrefs
Initially, unranked memref descriptors in the LLVM dialect were designed only
to be passed into functions. An assertion was guarding against returning
unranked memrefs from functions in the standard-to-LLVM conversion. This is
insufficient for functions that wish to return an unranked memref such that the
caller does not know the rank in advance, and hence cannot allocate the
descriptor and pass it in as an argument.

Introduce a calling convention for returning unranked memref descriptors as
follows. An unranked memref descriptor always points to a ranked memref
descriptor stored on stack of the current function. When an unranked memref
descriptor is returned from a function, the ranked memref descriptor it points
to is copied to dynamically allocated memory, the ownership of which is
transferred to the caller. The caller is responsible for deallocating the
dynamically allocated memory and for copying the pointed-to ranked memref
descriptor onto its stack.

Provide default lowerings for std.return, std.call and std.indirect_call that
maintain the conversion defined above.

This convention is additionally exercised by a runtime test to guard against
memory errors.

Differential Revision: https://reviews.llvm.org/D82647
2020-06-26 15:37:37 +02:00
..
include [mlir][test] NFC - Rename cblas to mlir_test_cblas 2020-04-09 16:13:33 -04:00
CMakeLists.txt [mlir][test] NFC - Rename cblas to mlir_test_cblas 2020-04-09 16:13:33 -04:00
bare_ptr_call_conv.mlir [mlir] Rename conversions involving ex-Loop dialect to mention SCF 2020-05-15 10:45:11 +02:00
linalg_integration_test.mlir [mlir][Linalg] Retire C++ MatmulOp in favor of a linalg-ods-gen'd op. 2020-06-16 10:46:35 -04:00
lit.local.cfg Fix `check-mlir` target when the host target isn't configured 2020-06-19 06:36:20 +00:00
mlir_test_cblas.cpp [mlir][test] NFC - Rename cblas to mlir_test_cblas 2020-04-09 16:13:33 -04:00
mlir_test_cblas_interface.cpp [mlir][test] NFC - Rename cblas to mlir_test_cblas 2020-04-09 16:13:33 -04:00
sgemm_naive_codegen.mlir [MLIR][Standard] Make the `dim` operation index an operand. 2020-06-10 13:54:47 +00:00
simple.mlir [JitRunner] add support for i32 and i64 output 2020-06-09 22:25:03 -07:00
unranked_memref.mlir [mlir] support returning unranked memrefs 2020-06-26 15:37:37 +02:00
utils.mlir [MLIR] Helper class referencing MemRefType to unify runner implementations. 2020-05-26 16:32:36 +02:00