[flang-commits] [PATCH] D145360: [flang][hlfir] Lower intrinsic module procedures to HLFIR

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Mar 6 00:28:50 PST 2023


jeanPerier created this revision.
jeanPerier added reviewers: clementval, PeteSteinfeld.
jeanPerier added a project: Flang.
Herald added subscribers: sunshaoce, mehdi_amini, jdoerfert.
Herald added a project: All.
jeanPerier requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

Intrinsic module procedures are a bit different from intrinsic
procedures: they are defined in intrinsic module files, but their
signature and representation in semantics is the same as user
procedures.
The code to lower them in lowering (when they are not implemented in
Fortran) is the same as for intrinsic procedures
(Optimizer/Builder/IntrinsicCall.cpp).

The dispatching in in HLFIR procedure reference lowering must be
slightly modified so that these evaluate::ProcRef that have a
semantics::Symbol instead of an evaluate::SpecificIntrinsic can
be dispatched as evaluate::SpecificIntrinsic:

- move isIntrinsicModuleProcedure to detect them
- in the helpers dealing with intrinsics, make evaluate::SpecificIntrinsic a pointer argument that can be null for intrinsic module procedures.
- add getProcedureName() to call context to avoid relying on the evaluate::SpecificIntrinsic when it is not know to be null.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145360

Files:
  flang/include/flang/Lower/ConvertCall.h
  flang/lib/Lower/ConvertCall.cpp
  flang/lib/Lower/ConvertExpr.cpp
  flang/test/Lower/HLFIR/intrinsic-module-procedures.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145360.502541.patch
Type: text/x-patch
Size: 13061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230306/6c5c7432/attachment-0001.bin>


More information about the flang-commits mailing list