[mlir][SideEffects] Replace HasNoSideEffect with the memory effect interfaces.
authorRiver Riddle <riddleriver@gmail.com>
Thu, 12 Mar 2020 21:06:41 +0000 (14:06 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Thu, 12 Mar 2020 21:26:15 +0000 (14:26 -0700)
commit0ddba0bd59c337f16b51a00cb205ecfda46f97fa
treebe1aaf1254f0c625d48ba66270d69b0db8b38a2e
parent907403f342fe661b590f930a83f940c67b3ff855
[mlir][SideEffects] Replace HasNoSideEffect with the memory effect interfaces.

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
23 files changed:
mlir/docs/Traits.md
mlir/docs/Tutorials/Toy/Ch-2.md
mlir/include/mlir/IR/Operation.h
mlir/include/mlir/IR/OperationSupport.h
mlir/include/mlir/Interfaces/SideEffects.h
mlir/include/mlir/Interfaces/SideEffects.td
mlir/include/mlir/TableGen/SideEffects.h
mlir/include/mlir/Transforms/FoldUtils.h
mlir/lib/Analysis/Utils.cpp
mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
mlir/lib/Dialect/LoopOps/Transforms/ParallelLoopFusion.cpp
mlir/lib/Interfaces/SideEffects.cpp
mlir/lib/TableGen/SideEffects.cpp
mlir/lib/Transforms/CSE.cpp
mlir/lib/Transforms/LoopInvariantCodeMotion.cpp
mlir/lib/Transforms/Utils/FoldUtils.cpp
mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
mlir/lib/Transforms/Utils/LoopUtils.cpp
mlir/lib/Transforms/Utils/RegionUtils.cpp
mlir/test/Transforms/canonicalize.mlir
mlir/test/mlir-tblgen/op-decl.td
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp