[PATCH] D78619: [mlir] Extended Alloc and Dealloc operations with memory-effect traits.
Julian Gross via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 27 03:43:15 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG262108e12ed9: [mlir] Extended Alloc and Dealloc operations with memory-effect traits. (authored by dfki-jugr).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78619/new/
https://reviews.llvm.org/D78619
Files:
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
Index: mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
===================================================================
--- mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
+++ mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
@@ -129,12 +129,14 @@
//
// %0 = alloclike(%m)[%s] : memref<8x?xf32, (d0, d1)[s0] -> ((d0 + s0), d1)>
//
-class AllocLikeOp<string mnemonic, list<OpTrait> traits = []> :
+class AllocLikeOp<string mnemonic,
+ list<OpVariableDecorator> resultDecorators = [],
+ list<OpTrait> traits = []> :
Std_Op<mnemonic, traits> {
let arguments = (ins Variadic<Index>:$value,
Confined<OptionalAttr<I64Attr>, [IntMinValue<0>]>:$alignment);
- let results = (outs AnyMemRef);
+ let results = (outs Arg<AnyMemRef, "", resultDecorators>);
let builders = [OpBuilder<
"Builder *builder, OperationState &result, MemRefType memrefType", [{
@@ -276,7 +278,7 @@
// AllocOp
//===----------------------------------------------------------------------===//
-def AllocOp : AllocLikeOp<"alloc"> {
+def AllocOp : AllocLikeOp<"alloc", [MemAlloc], [MemoryEffects<[MemAlloc]>]> {
let summary = "memory allocation operation";
let description = [{
The `alloc` operation allocates a region of memory, as specified by its
@@ -1253,7 +1255,7 @@
// DeallocOp
//===----------------------------------------------------------------------===//
-def DeallocOp : Std_Op<"dealloc"> {
+def DeallocOp : Std_Op<"dealloc", [MemoryEffects<[MemFree]>]> {
let summary = "memory deallocation operation";
let description = [{
The `dealloc` operation frees the region of memory referenced by a memref
@@ -1269,7 +1271,7 @@
```
}];
- let arguments = (ins AnyMemRef:$memref);
+ let arguments = (ins Arg<AnyMemRef, "", [MemFree]>:$memref);
let hasCanonicalizer = 1;
let hasFolder = 1;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78619.260268.patch
Type: text/x-patch
Size: 1881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200427/c0202d50/attachment.bin>
More information about the llvm-commits
mailing list