You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* WIP: alternative lowering for memrefs
Introduce an alternative lowering scheme for memref types. A n-D memref
is always lowered to a pointer to an (n-1)-D nested LLVM array type, a
0-D and a 1-D memref is lowered to a bare pointer. This applies both at
function boundaries and within functions, unlike the MLIR's bare pointer
calling convention. This lowering is only possible for memrefs with
static shapes except for the outermost dimension, which is consistent
with the kinds of nested array structure C allows and therefore suitable
for a C frontend. However, it only supports a subset of memref dialect
operations that are possible to implement using this data structure. For
example, view, subview and transpose cannot be implemented as they
result in non-row-major layouts unexpressible with C nested arrays.
This simplifies the lowering and the generated IR for all supported
memref operations and removes the need for the ABI duplication at the
function boundary: memrefs are lowered to the same LLVM IR as equivalent
nested arrays.
* Enable c memref
* Fix lowering c abi
* Fix compile issues
* Fix format
* Add unit tests and fix the bug discovered in the process
nD dynamic allocation was not taking into account the static part of the
shape leading to a smaller allocation than required.
* Update tests
Golden tests are simply rewritten with the version. The main difference
is the pervasiveness of `memref` in the function signatures and the
corresponding memref-to-pointer conversions (or lack thereof) around
function calls.
* Create a pointer2memref op if we cast between different types
* Do not use argv special case
* Fix bug with multiple definitions of malloc
* subindexlowering: bitcast after gepop
* Update test
* Bugfixes
* Cleanup
* Fix LLVM bump
* Fix tests
* Generalize tests
Co-authored-by: William S. Moses <[email protected]>
Co-authored-by: Ivan Radanov Ivanov <[email protected]>
0 commit comments