@@ -286,8 +286,7 @@ def fir_FreeMemOp : fir_Op<"freemem", [MemoryEffects<[MemFree]>]> {
286
286
let assemblyFormat = "$heapref attr-dict `:` qualified(type($heapref))";
287
287
}
288
288
289
- def fir_LoadOp : fir_OneResultOp<"load", [FirAliasTagOpInterface,
290
- DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
289
+ def fir_LoadOp : fir_OneResultOp<"load", [FirAliasTagOpInterface]> {
291
290
let summary = "load a value from a memory reference";
292
291
let description = [{
293
292
Load a value from a memory reference into an ssa-value (virtual register).
@@ -303,7 +302,7 @@ def fir_LoadOp : fir_OneResultOp<"load", [FirAliasTagOpInterface,
303
302
or null.
304
303
}];
305
304
306
- let arguments = (ins AnyReferenceLike:$memref,
305
+ let arguments = (ins Arg< AnyReferenceLike, "", [MemRead]> :$memref,
307
306
OptionalAttr<LLVM_TBAATagArrayAttr>:$tbaa);
308
307
309
308
let builders = [OpBuilder<(ins "mlir::Value":$refVal)>,
@@ -316,8 +315,7 @@ def fir_LoadOp : fir_OneResultOp<"load", [FirAliasTagOpInterface,
316
315
}];
317
316
}
318
317
319
- def fir_StoreOp : fir_Op<"store", [FirAliasTagOpInterface,
320
- DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
318
+ def fir_StoreOp : fir_Op<"store", [FirAliasTagOpInterface]> {
321
319
let summary = "store an SSA-value to a memory location";
322
320
323
321
let description = [{
@@ -337,7 +335,7 @@ def fir_StoreOp : fir_Op<"store", [FirAliasTagOpInterface,
337
335
}];
338
336
339
337
let arguments = (ins AnyType:$value,
340
- AnyReferenceLike:$memref,
338
+ Arg< AnyReferenceLike, "", [MemWrite]> :$memref,
341
339
OptionalAttr<LLVM_TBAATagArrayAttr>:$tbaa);
342
340
343
341
let builders = [OpBuilder<(ins "mlir::Value":$value, "mlir::Value":$memref)>];
@@ -350,7 +348,7 @@ def fir_StoreOp : fir_Op<"store", [FirAliasTagOpInterface,
350
348
}];
351
349
}
352
350
353
- def fir_CopyOp : fir_Op<"copy", [DeclareOpInterfaceMethods<MemoryEffectsOpInterface> ]> {
351
+ def fir_CopyOp : fir_Op<"copy", []> {
354
352
let summary = "copy constant size memory";
355
353
356
354
let description = [{
@@ -371,8 +369,8 @@ def fir_CopyOp : fir_Op<"copy", [DeclareOpInterfaceMethods<MemoryEffectsOpInterf
371
369
TODO: add FirAliasTagOpInterface to carry TBAA.
372
370
}];
373
371
374
- let arguments = (ins AnyRefOfConstantSizeAggregateType:$source,
375
- AnyRefOfConstantSizeAggregateType:$destination,
372
+ let arguments = (ins Arg< AnyRefOfConstantSizeAggregateType, "", [MemRead]> :$source,
373
+ Arg< AnyRefOfConstantSizeAggregateType, "", [MemWrite]> :$destination,
376
374
OptionalAttr<UnitAttr>:$no_overlap);
377
375
378
376
let builders = [OpBuilder<(ins "mlir::Value":$source,
@@ -1375,8 +1373,7 @@ def fir_BoxTypeDescOp : fir_SimpleOneResultOp<"box_tdesc", [NoMemoryEffect]> {
1375
1373
// !- Merge the new and old values into the memory for "A"
1376
1374
// array_merge_store <updated A> to <A's address>
1377
1375
1378
- def fir_ArrayLoadOp : fir_Op<"array_load", [AttrSizedOperandSegments,
1379
- DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
1376
+ def fir_ArrayLoadOp : fir_Op<"array_load", [AttrSizedOperandSegments]> {
1380
1377
1381
1378
let summary = "Load an array as a value.";
1382
1379
@@ -1415,7 +1412,7 @@ def fir_ArrayLoadOp : fir_Op<"array_load", [AttrSizedOperandSegments,
1415
1412
}];
1416
1413
1417
1414
let arguments = (ins
1418
- AnyRefOrBox:$memref,
1415
+ Arg< AnyRefOrBox, "", [MemRead]> :$memref,
1419
1416
Optional<AnyShapeOrShiftType>:$shape,
1420
1417
Optional<fir_SliceType>:$slice,
1421
1418
Variadic<AnyIntegerType>:$typeparams
@@ -1627,7 +1624,7 @@ def fir_ArrayAccessOp : fir_Op<"array_access", [AttrSizedOperandSegments,
1627
1624
1628
1625
It is only possible to use `array_access` on an `array_load` result value or
1629
1626
a value that can be trace back transitively to an `array_load` as the
1630
- dominating source. Other array operations such as `array_amend` can be in
1627
+ dominating source. Other array operation such as `array_amend` can be in
1631
1628
between.
1632
1629
1633
1630
TODO: The above restriction is not enforced. The design of the operation
@@ -1688,7 +1685,7 @@ def fir_ArrayAmendOp : fir_Op<"array_amend", [NoMemoryEffect]> {
1688
1685
}
1689
1686
1690
1687
def fir_ArrayMergeStoreOp : fir_Op<"array_merge_store",
1691
- [AttrSizedOperandSegments, DeclareOpInterfaceMethods<MemoryEffectsOpInterface> ]> {
1688
+ [AttrSizedOperandSegments]> {
1692
1689
1693
1690
let summary = "Store merged array value to memory.";
1694
1691
@@ -1717,7 +1714,7 @@ def fir_ArrayMergeStoreOp : fir_Op<"array_merge_store",
1717
1714
let arguments = (ins
1718
1715
fir_SequenceType:$original,
1719
1716
fir_SequenceType:$sequence,
1720
- AnyRefOrBox:$memref,
1717
+ Arg< AnyRefOrBox, "", [MemWrite]> :$memref,
1721
1718
Optional<fir_SliceType>:$slice,
1722
1719
Variadic<AnyIntegerType>:$typeparams
1723
1720
);
@@ -2755,22 +2752,6 @@ def fir_AddrOfOp : fir_OneResultOp<"address_of", [NoMemoryEffect]> {
2755
2752
let assemblyFormat = "`(` $symbol `)` attr-dict `:` type($resTy)";
2756
2753
}
2757
2754
2758
- def fir_VolatileCastOp : fir_SimpleOneResultOp<"volatile_cast", [NoMemoryEffect]> {
2759
- let summary = "cast between volatile and non-volatile types";
2760
- let description = [{
2761
- Cast between volatile and non-volatile types. The types must be otherwise
2762
- identical. A value's volatility cannot be changed by a fir.convert operation.
2763
- Reinterpreting a value as volatile must be done explicitly using this operation.
2764
- }];
2765
- let arguments = (ins AnyRefOrBox:$value);
2766
- let results = (outs AnyRefOrBox:$res);
2767
- let assemblyFormat = [{
2768
- $value attr-dict `:` functional-type($value, results)
2769
- }];
2770
- let hasVerifier = 1;
2771
- let hasFolder = 1;
2772
- }
2773
-
2774
2755
def fir_ConvertOp : fir_SimpleOneResultOp<"convert", [NoMemoryEffect]> {
2775
2756
let summary = "encapsulates all Fortran entity type conversions";
2776
2757
0 commit comments