[Mlir-commits] [mlir] [mlir][LLVM] Add support for `ptrtoaddr` (PR #185104)
Markus Böck
llvmlistbot at llvm.org
Sat Mar 7 04:47:29 PST 2026
================
@@ -3854,6 +3854,21 @@ LogicalResult LLVM::BitcastOp::verify() {
return success();
}
+LogicalResult LLVM::PtrToAddrOp::verify() {
----------------
zero9178 wrote:
I would nevertheless want to keep this verification to encourage this status quo to change. I don't think its that problematic for the following reasons:
* The default in the absence of an explicit datalayout is 64 bit pointers, which are the vast majority of targets
* Users can currently get by without `ptrtoaddr`. If they want to start using it, then adding a datalayout is not too big of an ask IMO
* One can create a MLIR datalayout from an LLVM datalayout at any time using the [llvm-target-to-datalayout](https://github.com/llvm/llvm-project/blob/4b84223aad4fb5f277aa524b6ff518f4e1cd0df7/mlir/include/mlir/Target/LLVMIR/Transforms/Passes.td#L14) pass.
* We will need to so at some point in the future anyhow (https://github.com/llvm/llvm-project/issues/96047)
* The LLVM dialect not catching illegal LLVM IR and then only failing once translation to LLVM proper occurs is a common complaint that I'd like to avoid
Pleast let me know if you feel strongly about this or if I am missing some detail. I have also added a description to the op to tell users.
https://github.com/llvm/llvm-project/pull/185104
More information about the Mlir-commits
mailing list