[MLIR] LLVM Dialect: add llvm.cmpxchg and improve llvm.atomicrmw custom parser
authorFrank Laub <frank.laub@intel.com>
Tue, 21 Jan 2020 08:22:01 +0000 (00:22 -0800)
committerFrank Laub <frank.laub@intel.com>
Tue, 21 Jan 2020 09:09:42 +0000 (01:09 -0800)
commitfffea2842d2807e6deabeb719774d83e3c490156
tree8a2a979e8b7021d10bc648eeba0066cc12f1c1d4
parent65f6ee618e729e2abcc9f7b6fff689c7b3d1aada
[MLIR] LLVM Dialect: add llvm.cmpxchg and improve llvm.atomicrmw custom parser

Summary:
Add a `llvm.cmpxchg` op as a counterpart to LLVM IR's `cmpxchg` instruction.
Note that the `weak`, `volatile`, and `syncscope` attributes are not yet supported.

This will be useful for upcoming parallel versions of affine.for and generally
for reduction-like semantics (especially for reductions that can't make use
of `atomicrmw`, e.g. `fmax`).

Reviewers: ftynse, nicolasvasilache

Reviewed By: ftynse

Subscribers: merge_guards_bot, jfb, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72995
mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/test/Dialect/LLVMIR/invalid.mlir
mlir/test/Dialect/LLVMIR/roundtrip.mlir
mlir/test/Target/llvmir.mlir