Skip to content

Commit f32170a

Browse files
committed
remove scope based for cuf.allocate
1 parent 9df89a0 commit f32170a

File tree

1 file changed

+9
-10
lines changed
  • flang/include/flang/Optimizer/Dialect/CUF

1 file changed

+9
-10
lines changed

flang/include/flang/Optimizer/Dialect/CUF/CUFOps.td

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def cuf_FreeOp : cuf_Op<"free", [MemoryEffects<[MemFree]>]> {
8585
let hasVerifier = 1;
8686
}
8787

88-
def cuf_AllocateOp : cuf_Op<"allocate", [AttrSizedOperandSegments]> {
88+
def cuf_AllocateOp
89+
: cuf_Op<"allocate", [AttrSizedOperandSegments,
90+
MemoryEffects<[MemAlloc<DefaultResource>]>]> {
8991
let summary = "Perform the device allocation of data of an allocatable";
9092

9193
let description = [{
@@ -94,15 +96,12 @@ def cuf_AllocateOp : cuf_Op<"allocate", [AttrSizedOperandSegments]> {
9496
is initialized before with the standard flang runtime calls.
9597
}];
9698

97-
// Value-scoped Allocate on the descriptor being allocated
98-
let arguments =
99-
(ins Arg<fir_ReferenceType,
100-
"", [MemAlloc<DefaultResource>, MemRead, MemWrite]>:$box,
101-
Arg<Optional<AnyRefOrBoxType>, "", [MemWrite]>:$errmsg,
102-
Optional<fir_ReferenceType>:$stream,
103-
Arg<Optional<AnyRefOrBoxType>, "", [MemWrite]>:$pinned,
104-
Arg<Optional<AnyRefOrBoxType>, "", [MemRead]>:$source,
105-
cuf_DataAttributeAttr:$data_attr, UnitAttr:$hasStat);
99+
let arguments = (ins Arg<fir_ReferenceType, "", [MemRead, MemWrite]>:$box,
100+
Arg<Optional<AnyRefOrBoxType>, "", [MemWrite]>:$errmsg,
101+
Optional<fir_ReferenceType>:$stream,
102+
Arg<Optional<AnyRefOrBoxType>, "", [MemWrite]>:$pinned,
103+
Arg<Optional<AnyRefOrBoxType>, "", [MemRead]>:$source,
104+
cuf_DataAttributeAttr:$data_attr, UnitAttr:$hasStat);
106105

107106
let results = (outs AnyIntegerType:$stat);
108107

0 commit comments

Comments
 (0)