[MLIR] Propagate input side effect information
authorTres Popp <tpopp@google.com>
Thu, 23 Apr 2020 16:13:44 +0000 (18:13 +0200)
committerTres Popp <tpopp@google.com>
Mon, 27 Apr 2020 09:35:52 +0000 (11:35 +0200)
commit2d2d696137d729dcd2d83330e4d3b9e305f96640
treee90262b195b8233ebaf69ddd083e168e563eb861
parent807fe05d3531cae47d0c770b2d919f861bfe9235
[MLIR] Propagate input side effect information

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
15 files changed:
mlir/include/mlir/Interfaces/SideEffects.td
mlir/include/mlir/Support/LLVM.h
mlir/include/mlir/TableGen/OpClass.h
mlir/include/mlir/TableGen/SideEffects.h
mlir/lib/TableGen/OpClass.cpp
mlir/lib/TableGen/SideEffects.cpp
mlir/test/Conversion/StandardToSPIRV/legalization.mlir
mlir/test/Conversion/VectorToLoops/vector-to-loops.mlir
mlir/test/Dialect/Affine/canonicalize.mlir
mlir/test/Dialect/GPU/all-reduce-max.mlir
mlir/test/Dialect/GPU/all-reduce.mlir
mlir/test/Dialect/Linalg/loops.mlir
mlir/test/Dialect/Linalg/parallel_loops.mlir
mlir/test/Transforms/canonicalize.mlir
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp