[all-commits] [llvm/llvm-project] 727eca: [flang] allow intrinsic module procedures to be im...

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Jul 8 07:30:49 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 727ecaf7d16d44ecf434284c60ad65b22d814092
      https://github.com/llvm/llvm-project/commit/727ecaf7d16d44ecf434284c60ad65b22d814092
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-07-08 (Mon, 08 Jul 2024)

  Changed paths:
    M flang/include/flang/Optimizer/Builder/IntrinsicCall.h
    M flang/lib/Lower/ConvertCall.cpp
    M flang/lib/Optimizer/Builder/IntrinsicCall.cpp

  Log Message:
  -----------
  [flang] allow intrinsic module procedures to be implemented in Fortran (#97743)

Currently, all procedures from intrinsic modules that are not BIND(C)
are expected to be intercepted by the compiler in lowering and to have a
handler in IntrinsicCall.cpp.

As more "intrinsic" modules are being added (OpenMP, OpenACC, CUF, ...),
this requirement is preventing seamless implementation of intrinsic
modules in Fortran. Procedures from intrinsic modules are different from
generic intrinsics defined in section 16 of the standard. They are
declared in Fortran file seating in the intrinsic module directory and
inside the compiler they look like regular user call except for the
INTRINSIC attribute set on their module. So an easy implementation is
just to have the implementation done in Fortran and linked to the
runtime without any need for the compiler to necessarily understand and
handle these calls in special ways.

This patch splits the lookup and generation part of IntrinsicCall.cpp so
that it can be allowed to only intercept calls to procedure from
intrinsic module if they have a handler. Otherwise, the assumption is
that they should be implemented in Fortran.

Add explicit TODOs handler for the IEEE procedure that are known to not
yet been implemented and won't be implemented via Fortran code so that
this patch is an NFC for what is currently supported.

This patch also prevents doing two lookups in the intrinsic table (There
was one to get argument lowering rules, and another one to generate the
code).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list