[all-commits] [llvm/llvm-project] 124338: [flang] Increase support for intrinsic module proc...

vdonaldson via All-commits all-commits at lists.llvm.org
Thu Jun 23 09:04:23 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 124338dd8016dc7589685d9fc731b178f2b5d379
  Author: Val Donaldson <vdonaldson at nvidia.com>
  Date:   2022-06-23 (Thu, 23 Jun 2022)

  Changed paths:
    M flang/include/flang/Lower/IntrinsicCall.h
    M flang/lib/Lower/ConvertExpr.cpp
    M flang/lib/Lower/IntrinsicCall.cpp
    M flang/module/__fortran_ieee_exceptions.f90
    M flang/module/ieee_arithmetic.f90
    A flang/test/Lower/intrinsic-procedures/ieee_is_finite.f90
    A flang/test/Lower/intrinsic-procedures/ieee_operator_eq.f90

  Log Message:
  [flang] Increase support for intrinsic module procedures

* Make Semantics test doconcurrent01.f90 an expected failure pending a fix
for a problem in recognizing a PURE prefix specifier for a specific procedure
that occurs in new intrinsic module source code,

* review update

* review update

* Increase support for intrinsic module procedures

The f18 standard defines 5 intrinsic modules that define varying numbers
of procedures, including several operators:

  2  iso_fortran_env
 55  ieee_arithmetic
 10  ieee_exceptions
  0  ieee_features
  6  iso_c_binding

There are existing fortran source files for each of these intrinsic modules.
This PR adds generic procedure declarations to these files for procedures
that do not already have them, together with associated specific procedure
declarations.  It also adds the capability of recognizing intrinsic module
procedures in lowering code, making it possible to use existing language
intrinsic code generation for intrinsic module procedures for both scalar
and elemental calls.  Code can then be generated for intrinsic module
procedures using existing options, including front end folding, direct
inlining, and calls to runtime support routines.  Detailed code generation
is provided for several procedures in this PR, with others left to future PRs.
Procedure calls that reach lowering and don't have detailed implementation
support will generate a "not yet implemented" message with a recognizable name.

The generic procedures in these modules may each have as many as 36 specific
procedures.  Most specific procedures are generated via macros that generate
type specific interface declarations.  These specific declarations provide
detailed argument information for each individual procedure call, similar
to what is done via other means for standard language intrinsics.  The
modules only provide interface declarations.  There are no procedure
definitions, again in keeping with how language intrinsics are processed.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D128431

Co-authored-by: V Donaldson <vdonaldson at nvidia.com>

More information about the All-commits mailing list