4 Commits

Author SHA1 Message Date
Matthias Springer
206fad0e21
[mlir][NFC] Mark type converter in populate... functions as const (#111250)
This commit marks the type converter in `populate...` functions as
`const`. This is useful for debugging.

Patterns already take a `const` type converter. However, some
`populate...` functions do not only add new patterns, but also add
additional type conversion rules. That makes it difficult to find the
place where a type conversion was added in the code base. With this
change, all `populate...` functions that only populate pattern now have
a `const` type converter. Programmers can then conclude from the
function signature that these functions do not register any new type
conversion rules.

Also some minor cleanups around the 1:N dialect conversion
infrastructure, which did not always pass the type converter as a
`const` object internally.
2024-10-05 21:32:40 +02:00
Markus Böck
a8599ac242 [mlir][UBToLLVM] Do not arbitrarily restrict input types
The lowering pattern is currently restricted to integer, float and index types.
This is seemingly arbitrary, as `ub.poison` works for any input type. The lowering should therefore also work with any type that can be converted using the type converter.

This patch therefore simply removes that condition and adds a test ensuring that this works.

Differential Revision: https://reviews.llvm.org/D158982
2023-08-28 17:16:21 +02:00
Matthias Springer
bfdc47232c [mlir][Conversion] Implement ConvertToLLVMPatternInterface (2)
Implement ConvertToLLVMPatternInterface for more dialects: index, math,
ub.

Differential Revision: https://reviews.llvm.org/D157478
2023-08-09 10:28:15 +02:00
Ivan Butygin
0f446adf67 [mlir] Convert ub.poison to llvm.poison
Differential Revision: https://reviews.llvm.org/D155945
2023-07-24 18:40:12 +02:00