[Mlir-commits] [mlir] [mlir][ptr] Add ConstantOp with NullAttr and AddressAttr support (PR #157347)

Fabian Mora llvmlistbot at llvm.org
Sun Sep 14 08:22:38 PDT 2025


================
@@ -314,6 +363,9 @@ class PtrDialectLLVMIRTranslationInterface
                    LLVM::ModuleTranslation &moduleTranslation) const final {
 
     return llvm::TypeSwitch<Operation *, LogicalResult>(op)
+        .Case([&](ConstantOp constantOp) {
+          return convertConstantOp(constantOp, builder, moduleTranslation);
+        })
         .Case([&](PtrAddOp ptrAddOp) {
           return convertPtrAddOp(ptrAddOp, builder, moduleTranslation);
----------------
fabianmcg wrote:

Currently `convert` is used in other places: https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h#L45

I don't mind changing it for ptr, should I bundle all the ptr convert -> translate in this single PR? All the ops being translated currently use the convert naming.

https://github.com/llvm/llvm-project/pull/157347


More information about the Mlir-commits mailing list