[PATCH] D72995: [MLIR] LLVM Dialect: add llvm.cmpxchg and improve llvm.atomicrmw custom parser

JF Bastien via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 15:41:38 PST 2020


jfb added inline comments.


================
Comment at: mlir/test/Dialect/LLVMIR/invalid.mlir:499
+func @cmpxchg_success_must_be_stronger(%i32_ptr : !llvm<"i32*">, %i32 : !llvm.i32) {
+  // expected-error at +1 {{failure ordering must be no stronger than success ordering}}
+  %0 = llvm.cmpxchg %i32_ptr, %i32, %i32 monotonic acquire : !llvm.i32
----------------
That restriction came from C++11 and is no longer in place in C++17:
http://wg21.link/P0418
See note on `failure` on https://en.cppreference.com/w/cpp/atomic/atomic/compare_exchange

Seems like a bug in LLVM IR to enforce this, would be good if you could fix LLVM IR and not copy that specific mistake :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72995/new/

https://reviews.llvm.org/D72995





More information about the llvm-commits mailing list