[flang-commits] [PATCH] D100897: [flang] Make 'team_number()' an intrinsic function

Craig E Rasmussen via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Apr 20 15:49:40 PDT 2021


craig.rasmussen added inline comments.


================
Comment at: flang/lib/Evaluate/intrinsics.cpp:107
 static constexpr TypePattern BOZ{IntType, KindCode::typeless};
-static constexpr TypePattern TEAM_TYPE{IntType, KindCode::teamType};
+static constexpr TypePattern TEAM_TYPE{DerivedType, KindCode::teamType};
 static constexpr TypePattern DoublePrecision{
----------------
I think that the type here should be DerivedType rather than IntType (as I've changed it to be). However, I'm not sure as I'm rather confused about the implications of this. It does apparently fix the intrinsic function image_status() (for which there isn't a test yet).


================
Comment at: flang/lib/Evaluate/intrinsics.cpp:747
     {"tanh", {{"x", SameFloating}}, SameFloating},
+    {"team_number", {}, DefaultInt, Rank::scalar,
+        IntrinsicClass::transformationalFunction},
----------------
I tried to create only one entry here for team_number but couldn't work it out.  It seems like Optionality::optional should work but it failed for me (see RequiredTeam and associated comments in the diff above).


================
Comment at: flang/lib/Evaluate/intrinsics.cpp:1297
       break;
+    case KindCode::teamType: // TODO: TEAM_TYPE
+      argOk = type->category() == TypeCategory::Derived;
----------------
It seems like more work is required here because argOk==true should only occur if the derived type is type(team_type), right? Can derived types have kinds (I suppose I should know that)?

In any case, once TEAM_TYPE is sorted out I can finish a lot more of coarray intrinsic functions.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100897



More information about the flang-commits mailing list