[Mlir-commits] [mlir] [MLIR][LLVM] Import dereferenceable metadata from LLVM IR (PR #130974)

Krzysztof Drewniak llvmlistbot at llvm.org
Wed Mar 12 09:37:25 PDT 2025


================
@@ -330,6 +330,42 @@ def AliasAnalysisOpInterface : OpInterface<"AliasAnalysisOpInterface"> {
   ];
 }
 
+def DereferenceableOpInterface : OpInterface<"DereferenceableOpInterface"> {
+  let description = [{
+    An interface for memory operations that can carry dereferenceable metadata.
+    It provides setters and getters for the operation's dereferenceable
+    attributes. The default implementations of the interface methods expect
+    the operation to have an attribute of type DereferenceableAttr.
+  }];
+
+  let cppNamespace = "::mlir::LLVM";
+
+  let methods = [
+    InterfaceMethod<
+      /*desc=*/        "Returns the dereferenceable attribute or nullptr",
+      /*returnType=*/  "::mlir::LLVM::DereferenceableAttr",
+      /*methodName=*/  "getDereferenceableOrNull",
----------------
krzysz00 wrote:

I'm curious - why is this called `getDereferencableOrNull` when it could be just `getDereferenceable`? IT's not symmetric with the setter

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


More information about the Mlir-commits mailing list