[MLIR] Check for static shape before bare pointer conversion
authorLorenzo Chelini <l.chelini@icloud.com>
Mon, 4 Apr 2022 13:22:30 +0000 (15:22 +0200)
committerLorenzo Chelini <l.chelini@icloud.com>
Tue, 5 Apr 2022 15:56:41 +0000 (17:56 +0200)
commitae0fb61303f84f64d4a84dedf72036672741f87f
treefa8468e609d4df9557419c597b2a2aac6746a3ba
parent83de1073824463ab80061a0687199079a3cd2931
[MLIR] Check for static shape before bare pointer conversion

Originally in the returnOp conversion, the result type was changing to bare
pointer if the type was a memref. This is incorrect as conversion to bare
pointer can only be done if the memref has static shape, strides and offset.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D123121
mlir/include/mlir/Conversion/LLVMCommon/TypeConverter.h
mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp
mlir/test/Conversion/FuncToLLVM/func-memref-return.mlir