summaryrefslogtreecommitdiff
path: root/mlir/lib/TableGen/SideEffects.cpp
AgeCommit message (Collapse)Author
2023-09-29[MLIR] Add stage to side effectcxy
[MLIR] Add stage and effectOnFullRegion to side effect This patch add stage and effectOnFullRegion to side effect for optimization pass to obtain more accurate information. Stage uses numbering to track the side effects's stage of occurrence. EffectOnFullRegion indicates if effect act on every single value of resource. RFC disscussion: https://discourse.llvm.org/t/rfc-add-effect-index-in-memroy-effect/72235 Differential Revision: https://reviews.llvm.org/D156087 Reviewed By: mehdi_amini, Mogball Differential Revision: https://reviews.llvm.org/D156087
2021-04-15[mlir] Add support for adding attribute+type traits/interfaces to tablegen defsRiver Riddle
This matches the current support provided to operations, and allows attaching traits, interfaces, and using the DeclareInterfaceMethods utility. This was missed when attribute/type generation was first added. Differential Revision: https://reviews.llvm.org/D100233
2020-07-12[mlir][ODS] Add support for specifying the namespace of an interface.River Riddle
The namespace can be specified using the `cppNamespace` field. This matches the functionality already present on dialects, enums, etc. This fixes problems with using interfaces on operations in a different namespace than the interface was defined in. Differential Revision: https://reviews.llvm.org/D83604
2020-05-08[mlir] Updated SideEffect interface definitions to use tablegen Resource ↵Marcel Koester
objects. The SideEffect interface definitions currently use string expressions to reference custom resource objects. This CL introduces Resource objects in tablegen definitions to simplify linking of resource reference to resource objects. Differential Revision: https://reviews.llvm.org/D78917
2020-04-27[MLIR] Propagate input side effect informationTres Popp
Summary: Previously operations like std.load created methods for obtaining their effects but did not inherit from the SideEffect interfaces when their parameters were decorated with the information. The resulting situation was that passes had no information on the SideEffects of std.load/store and had to treat them more cautiously. This adds the inheritance information when creating the methods. As a side effect, many tests are modified, as they were using std.load for testing and this oepration would be folded away as part of pattern rewriting. Tests are modified to use store or to reutn the result of the std.load. Reviewers: mravishankar, antiagainst, nicolasvasilache, herhut, aartbik, ftynse! Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, bader, grosul1, frgossen, Kayjukh, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78802
2020-03-12[mlir][SideEffects] Replace HasNoSideEffect with the memory effect interfaces.River Riddle
HasNoSideEffect can now be implemented using the MemoryEffectInterface, removing the need to check multiple things for the same information. This also removes an easy foot-gun for users as 'Operation::hasNoSideEffect' would ignore operations that dynamically, or recursively, have no side effects. This also leads to an immediate improvement in some of the existing users, such as DCE, now that they have access to more information. Differential Revision: https://reviews.llvm.org/D76036
2020-03-06[mlir][SideEffects] Enable specifying side effects directly on the ↵River Riddle
arguments/results of an operation. Summary: New classes are added to ODS to enable specifying additional information on the arguments and results of an operation. These classes, `Arg` and `Res` allow for adding a description and a set of 'decorators' along with the constraint. This enables specifying the side effects of an operation directly on the arguments and results themselves. Example: ``` def LoadOp : Std_Op<"load"> { let arguments = (ins Arg<AnyMemRef, "the MemRef to load from", [MemRead]>:$memref, Variadic<Index>:$indices); } ``` Differential Revision: https://reviews.llvm.org/D74440