[MLIR] Add std.atomic_rmw op
authorFrank Laub <frank.laub@intel.com>
Tue, 25 Feb 2020 00:49:52 +0000 (16:49 -0800)
committerFrank Laub <frank.laub@intel.com>
Tue, 25 Feb 2020 00:54:21 +0000 (16:54 -0800)
commitfe210a1ff2e90093e210bcbcc1184308903c7bdb
treedec1a69e48d3256c2d335ab8d8ec59e543180fc0
parent4e45ef4d77b74350ea5a64a216b046ea6be1b96f
[MLIR] Add std.atomic_rmw op

Summary:
The RFC for this op is here: https://llvm.discourse.group/t/rfc-add-std-atomic-rmw-op/489

The std.atmomic_rmw op provides a way to support read-modify-write
sequences with data race freedom. It is intended to be used in the lowering
of an upcoming affine.atomic_rmw op which can be used for reductions.

A lowering to LLVM is provided with 2 paths:
- Simple patterns: llvm.atomicrmw
- Everything else: llvm.cmpxchg

Differential Revision: https://reviews.llvm.org/D74401
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
mlir/test/IR/core-ops.mlir
mlir/test/IR/invalid-ops.mlir