[all-commits] [llvm/llvm-project] a0ef12: [mlir][LLVM] `LLVMTypeConverter`: Tighten material...
Matthias Springer via All-commits
all-commits at lists.llvm.org
Sat Nov 23 19:20:30 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a0ef12c64284abf59bc092b2535cce1247d5f9a4
https://github.com/llvm/llvm-project/commit/a0ef12c64284abf59bc092b2535cce1247d5f9a4
Author: Matthias Springer <me at m-sp.org>
Date: 2024-11-24 (Sun, 24 Nov 2024)
Changed paths:
M mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp
A mlir/test/Conversion/MemRefToLLVM/type-conversion.mlir
M mlir/test/lib/Dialect/LLVM/CMakeLists.txt
A mlir/test/lib/Dialect/LLVM/TestPatterns.cpp
M mlir/tools/mlir-opt/mlir-opt.cpp
Log Message:
-----------
[mlir][LLVM] `LLVMTypeConverter`: Tighten materialization checks (#116532)
This commit adds extra checks to the MemRef argument materializations in
the LLVM type converter. These materializations construct a
`MemRefType`/`UnrankedMemRefType` from the unpacked elements of a MemRef
descriptor or from a bare pointer.
The extra checks ensure that the inputs to the materialization function
are correct. It is possible that a user added extra type conversion
rules that convert MemRef types in a different way and the extra checks
ensure that we construct a MemRef descriptor only if the inputs are what
we expect.
This commit also drops a check around bare pointer materializations:
```
// This is a bare pointer. We allow bare pointers only for function entry
// blocks.
```
This check should not be part of the materialization function. Whether a
MemRef block argument is converted into a MemRef descriptor or a bare
pointer is decided in the lowering pattern. At the point of time when
materialization functions are executed, we already made that decision
and we should just materialize regardless of the input format.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list