[mlir][memref] Fix num elements in lowering of memref.alloca op to LLVM
authorFabian Mora <fmora.dev@gmail.com>
Mon, 22 May 2023 16:21:28 +0000 (16:21 +0000)
committerfmorac <fmora.dev@gmail.com>
Mon, 22 May 2023 16:23:00 +0000 (16:23 +0000)
commit041f1abee11c0d5b790776bb26287bdbc7fe058c
tree51a6ba45fe5fd79823a9a0d85fdbaa5fc0bd02df
parent986cbd80d1dc838c61abff24b8d7ac28dcf4ac2a
[mlir][memref] Fix num elements in lowering of memref.alloca op to LLVM

Fixes a mistake in the lowering of memref.alloca to llvm.alloca, as llvm.alloca uses the number of elements to allocate in the stack and not the size in bytes.

Reference:
LLVM IR: https://llvm.org/docs/LangRef.html#alloca-instruction
LLVM MLIR: https://mlir.llvm.org/docs/Dialects/LLVM/#llvmalloca-mlirllvmallocaop

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D150705
mlir/include/mlir/Conversion/LLVMCommon/Pattern.h
mlir/include/mlir/Conversion/MemRefToLLVM/AllocLikeConversion.h
mlir/lib/Conversion/LLVMCommon/Pattern.cpp
mlir/lib/Conversion/MemRefToLLVM/AllocLikeConversion.cpp
mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
mlir/test/Conversion/GPUToNVVM/wmma-ops-to-nvvm.mlir
mlir/test/Conversion/MemRefToLLVM/convert-dynamic-memref-ops.mlir
mlir/test/Conversion/MemRefToLLVM/convert-static-memref-ops.mlir