Port alloc/dealloc LLVM IR conversion into the LLVM IR dialect lowering
Implement the lowering of memref allocation and deallocation standard operations into the LLVM IR dialect. This largely follows the existing mechanism in MLIR-to-LLVM-IR translation for the sake of compatibility. A memref value is transformed into a memref descriptor value which holds the pointer to the underlying data buffer and the dynamic memref sizes. The buffer is allocated using `malloc` and freed using `free`. The lowering inserts declarations of these functions if necessary. Memref descriptors are values of the LLVM IR structure type wrapped into an MLIR LLVM dialect type. The pointer to the buffer and the individual sizes are accessed using `extractvalue` and `insertvalue` LLVM IR instructions. PiperOrigin-RevId: 232719419
Loading
Please sign in to comment