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

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 10 11:08:53 PDT 2021


PeteSteinfeld added a comment.

In D100897#2992783 <https://reviews.llvm.org/D100897#2992783>, @klausler wrote:

> In D100897#2992779 <https://reviews.llvm.org/D100897#2992779>, @craig.rasmussen wrote:
>
>> In a response @klausler asked:
>>
>>   Have you given up trying to construct a valid TEAM_TYPE derived type to characterize an absent TEAM= actual argument?
>>
>> Yes.  When I looked into doing this it didn't seem possible without major changes to the function interfaces in lib/Evaluate/intrinsics.cpp.  As far as I can tell, it doesn't seem possible to create a DerivedTypeSpec from the context, as it is a FoldingContext not a semantics::SemanticsContext.
>
> I'll have to do it, then.

Would it be possible to create a constant of type `TEAM_TYPE` in iso_fortran_env.f90 or __fortran_builtins.f90 to indicate the current team and then use that constant as the value of the missing optional argument?  This would mean that iso_fortran_env.f90 would need to be available to the compiler to process calls to the `TEAM_NUMBER()` intrinsic.


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

https://reviews.llvm.org/D100897



More information about the llvm-commits mailing list