[flang-commits] [flang] [mlir] [Flang] [OpenMP] atomic compare (PR #184761)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Mon Apr 20 03:15:44 PDT 2026


================
@@ -4532,8 +4532,13 @@ convertOmpAtomicCompare(omp::AtomicCompareOp atomicCompareOp,
         "unable to determine element type for atomic compare");
 
   llvm::Value *llvmX = moduleTranslation.lookupValue(atomicCompareOp.getX());
+
+  // Fortran integers are signed, and the OpenMPIRBuilder may use signedness
+  // for GT/LT atomic compare operations. Set IsSigned=true to produce correct
+  // code for all valid inputs.
----------------
tblah wrote:

Fortran integers are signed but not all MLIR integers are signed. This needs to be correctly set according to the type being compared.

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


More information about the flang-commits mailing list