@@ -80,8 +80,7 @@ def AnyRefOfConstantSizeAggregateType : TypeConstraint<
8080// Memory SSA operations
8181//===----------------------------------------------------------------------===//
8282
83- def fir_AllocaOp : fir_Op<"alloca", [AttrSizedOperandSegments,
84- MemoryEffects<[MemAlloc<AutomaticAllocationScopeResource>]>]> {
83+ def fir_AllocaOp : fir_Op<"alloca", [AttrSizedOperandSegments]> {
8584 let summary = "allocate storage for a temporary on the stack given a type";
8685 let description = [{
8786 This primitive operation is used to allocate an object on the stack. A
@@ -162,7 +161,9 @@ def fir_AllocaOp : fir_Op<"alloca", [AttrSizedOperandSegments,
162161 Variadic<AnyIntegerType>:$shape
163162 );
164163
165- let results = (outs fir_ReferenceType);
164+ let results =
165+ (outs Res<fir_ReferenceType,
166+ "", [MemAlloc<AutomaticAllocationScopeResource>]>:$res);
166167
167168 let hasCustomAssemblyFormat = 1;
168169 let hasVerifier = 1;
@@ -212,8 +213,7 @@ def fir_AllocaOp : fir_Op<"alloca", [AttrSizedOperandSegments,
212213 }];
213214}
214215
215- def fir_AllocMemOp : fir_Op<"allocmem",
216- [MemoryEffects<[MemAlloc<DefaultResource>]>, AttrSizedOperandSegments]> {
216+ def fir_AllocMemOp : fir_Op<"allocmem", [AttrSizedOperandSegments]> {
217217 let summary = "allocate storage on the heap for an object of a given type";
218218
219219 let description = [{
@@ -235,7 +235,7 @@ def fir_AllocMemOp : fir_Op<"allocmem",
235235 Variadic<AnyIntegerType>:$typeparams,
236236 Variadic<AnyIntegerType>:$shape
237237 );
238- let results = (outs fir_HeapType);
238+ let results = (outs Res< fir_HeapType, "", [MemAlloc<DefaultResource>]>:$res );
239239
240240 let hasCustomAssemblyFormat = 1;
241241 let hasVerifier = 1;
0 commit comments