[llvm-branch-commits] [mlir] [mlir][LLVM] `LLVMTypeConverter`: Tighten materialization checks (PR #116532)
Matthias Springer via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Nov 17 22:52:39 PST 2024
matthias-springer wrote:
> shouldn't a user add their own argument materialization in this case that can handle their type conversion and the dialect conversion will then call that first?
Yes that's right. But if users forget to do that, they see a more cryptic error message because we are generating invalid IR. (Inserting a value of incorrect type into an LLVM struct.) If the materialization functions bails, it will trigger the `unrealized_conversion_cast` materialization, that can be debugged more easily.
One reason why I'd like to add these extra checks is because they helped me adapting the MemRef type conversion rules in #116524. I think these checks will also be useful for others.
> Is there an easy way we can test this by any chance?
There was no good place to add such tests until now. I added a new `TestPatterns.cpp` in `test/lib/Dialect/LLVM`.
https://github.com/llvm/llvm-project/pull/116532
More information about the llvm-branch-commits
mailing list