[Mlir-commits] [mlir] [mlir][ptr] Add the `ptradd` and `type_offset` ops, and `int_space` attr (PR #136434)

Tobias Gysi llvmlistbot at llvm.org
Sat Apr 19 12:11:52 PDT 2025


================
@@ -12,6 +12,69 @@
 include "mlir/Dialect/Ptr/IR/PtrDialect.td"
 include "mlir/Dialect/Ptr/IR/PtrAttrDefs.td"
 include "mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.td"
+include "mlir/Interfaces/SideEffectInterfaces.td"
 include "mlir/IR/OpAsmInterface.td"
 
+//===----------------------------------------------------------------------===//
+// PtrAddOp
+//===----------------------------------------------------------------------===//
+
+def Ptr_PtrAddOp : Pointer_Op<"ptradd", [
+    Pure, AllTypesMatch<["base", "result"]>
----------------
gysit wrote:

The `ViewLikeOpInterface` could be nice when searching the underlying memory object (e.g. here https://github.com/llvm/llvm-project/blob/031475594abd8a66b88a1687706651579e840421/mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp#L236) 

We can also add this later on though once needed.

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


More information about the Mlir-commits mailing list