[flang-commits] [PATCH] D133174: [flang] Add atomic_fetch_or to the list of intrinsics

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Sep 26 05:50:31 PDT 2022


jeanPerier added a comment.

Maybe @klausler has an idea to manage computing atomic_int_kind in https://github.com/llvm/llvm-project/blob/main/flang/include/flang/Runtime/magic-numbers.h  and use that in both the module file and the compiler (I don't) ?

As an alternative however, instead of the cmake gymnastic, I would suggest moving the definition of atomic_int_kind parameter as __builting_atomic_int_kind in https://github.com/llvm/llvm-project/blob/main/flang/module/__fortran_builtins.f90, rename it as atomic_int_kind  in https://github.com/llvm/llvm-project/blob/main/flang/module/iso_fortran_env.f90, and extract the builtin parameter symbol and its value in a similar way as it is done for builtin types in `GetBuiltinDerivedType` defined here: https://github.com/llvm/llvm-project/blob/2944f8ef049fa83ee96159c390fa893f251558da/flang/lib/Evaluate/intrinsics.cpp#L1202.



================
Comment at: flang/lib/Evaluate/intrinsics.cpp:1593
+        } else if (ExtractCoarrayRef(*arg)) {
+          argOk = true;
+        } else {
----------------
I am not well versed in coarrays, and the standard phrasing "shall be a scalar coarray or coindexed object" is a bit ambiguous to me. Are you sure the "scalar" part does not also apply to coindexed objects ? It is not entirely clear to me why it would apply on Corarray and not coarray references. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133174



More information about the flang-commits mailing list