[PATCH] D74439: [mlir][SideEffects] Define a set of interfaces and traits for defining side effects
River Riddle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 11 13:18:50 PST 2020
rriddle created this revision.
rriddle added reviewers: mehdi_amini, jpienaar.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, mgorny.
Herald added a reviewer: antiagainst.
Herald added a project: LLVM.
rriddle added a child revision: D74440: [mlir][SideEffects] Enable specifying side effects directly on the arguments/results of an operation..
This revision introduces the infrastructure for defining side-effects and attaching them to operations. This infrastructure allows for defining different types of side effects, that don't interact with each other, but use the same internal mechanisms. At the base of this is an interface that allows operations to specify the different effect instances that are exhibited by a specific operation instance. An effect instance is comprised of the following:
- Effect: The specific effect being applied. For memory related effects this may be reading from memory, storing to memory, etc.
- Value: A specific value, either operand/result/region argument, the effect pertains to.
- Resource: This is a global entity that represents the domain within which the effect is being applied.
MLIR serves many different abstractions, which cover many different domains. Simple effects are may have very different context, for example writing to an in-memory buffer vs a database. This revision defines uses this infrastructure to define a set of initial MemoryEffects. The are effects that generally correspond to memory of some kind; Allocate, Free, Read, Write.
This set of memory effects will be used in follow revisions to generalize various parts of the compiler, and make others more powerful(e.g. DCE).
This infrastructure was originally proposed here:
https://groups.google.com/a/tensorflow.org/g/mlir/c/v2mNl4vFCUM
Depends On D74438 <https://reviews.llvm.org/D74438>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D74439
Files:
mlir/include/mlir/IR/CMakeLists.txt
mlir/include/mlir/IR/OpBase.td
mlir/include/mlir/IR/OpDefinition.h
mlir/include/mlir/IR/SideEffects.td
mlir/lib/IR/CMakeLists.txt
mlir/lib/IR/Operation.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74439.243971.patch
Type: text/x-patch
Size: 19310 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200211/b5990529/attachment.bin>
More information about the llvm-commits
mailing list