[Mlir-commits] [flang] [llvm] [mlir] [openmp][mlir] Expand use of atomicrmw for atomic update (PR #215654)

Sairudra More llvmlistbot at llvm.org
Sat Oct 17 05:02:15 PDT 2026


================
@@ -11362,9 +11362,6 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createAtomicUpdate(
     assert((XElemTy->isFloatingPointTy() || XElemTy->isIntegerTy() ||
             XElemTy->isPointerTy() || XElemTy->isStructTy()) &&
            "OMP atomic update expected a scalar or struct type");
-    assert((RMWOp != AtomicRMWInst::Max) && (RMWOp != AtomicRMWInst::Min) &&
-           (RMWOp != AtomicRMWInst::UMax) && (RMWOp != AtomicRMWInst::UMin) &&
-           "OpenMP atomic does not support LT or GT operations");
----------------
Saieiei wrote:

`createAtomicCapture` still has this Max/Min assertion, so an smax or smin capture now aborts there with `-debug-only=openmp-ir-builder` in an assertions build. The RMWOp docs in OMPIRBuilder.h also still say FADD and FSUB use cmpxchg. Could both be updated? Removing the assertion there fixes the abort for me.

https://github.com/llvm/llvm-project/pull/215654


More information about the Mlir-commits mailing list