[Mlir-commits] [mlir] [MLIR][LLVM] Deprecate typed pointer operation builder (PR #70576)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Oct 28 14:55:57 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-llvm

Author: Christian Ulmann (Dinistro)

<details>
<summary>Changes</summary>

This commit deprecates LLVM dialect builders that expect typed pointers. In the process of removing typed pointers from the LLVM dialect, these builders will eventually be removed.



---
Full diff: https://github.com/llvm/llvm-project/pull/70576.diff


1 Files Affected:

- (modified) mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td (+8-4) 


``````````diff
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
index 2a572ab4de706a3..638c31b39682ea6 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
@@ -210,7 +210,8 @@ def LLVM_AllocaOp : LLVM_Op<"alloca",
       TypeAttr::get(allocatedType), allocaInst->isUsedWithInAlloca());
   }];
   let builders = [
-    OpBuilder<(ins "Type":$resultType, "Value":$arraySize,
+    DeprecatedOpBuilder<"the usage of typed pointers is deprecated",
+               (ins "Type":$resultType, "Value":$arraySize,
                "unsigned":$alignment),
     [{
       assert(!::llvm::cast<LLVMPointerType>(resultType).isOpaque() &&
@@ -281,10 +282,12 @@ def LLVM_GEPOp : LLVM_Op<"getelementptr", [Pure,
     OpBuilder<(ins "Type":$resultType, "Type":$basePtrType, "Value":$basePtr,
                "ValueRange":$indices, CArg<"bool", "false">:$inbounds,
                CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes)>,
-    OpBuilder<(ins "Type":$resultType, "Value":$basePtr,
+    DeprecatedOpBuilder<"the usage of typed pointers is deprecated",
+               (ins "Type":$resultType, "Value":$basePtr,
                "ValueRange":$indices, CArg<"bool", "false">:$inbounds,
                CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes)>,
-    OpBuilder<(ins "Type":$resultType, "Value":$basePtr,
+    DeprecatedOpBuilder<"the usage of typed pointers is deprecated",
+               (ins "Type":$resultType, "Value":$basePtr,
                "ArrayRef<GEPArg>":$indices, CArg<"bool", "false">:$inbounds,
                CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes)>,
     OpBuilder<(ins "Type":$resultType, "Type":$basePtrType, "Value":$basePtr,
@@ -388,7 +391,8 @@ def LLVM_LoadOp : LLVM_MemAccessOpBase<"load",
         getLLVMSyncScope(loadInst));
   }];
   let builders = [
-    OpBuilder<(ins "Value":$addr, CArg<"unsigned", "0">:$alignment,
+    DeprecatedOpBuilder<"the usage of typed pointers is deprecated",
+      (ins "Value":$addr, CArg<"unsigned", "0">:$alignment,
       CArg<"bool", "false">:$isVolatile, CArg<"bool", "false">:$isNonTemporal)>,
     OpBuilder<(ins "Type":$type, "Value":$addr,
       CArg<"unsigned", "0">:$alignment, CArg<"bool", "false">:$isVolatile,

``````````

</details>


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


More information about the Mlir-commits mailing list