[flang-commits] [PATCH] D83051: [flang][NFC] Move and rework pgmath description used in folding

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Jul 2 07:33:09 PDT 2020


jeanPerier created this revision.
jeanPerier added reviewers: schweitz, klausler, sscalpone.
jeanPerier added a project: Flang.
Herald added subscribers: llvm-commits, mgorny.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.

This change prepares usage of lipgmath description in lowering.

- Removes the static variable templates that were used to abstract libpgmath description
- Move the description to pgmath.h.inc header and rework the macros so that they can both be used to declare pgmath functions and use them. The way they are to be used is left to pgmath.h.inc user that must define PGMATH_USE_XX macros that will be called for all pgmath functions in pgmath.h.inc.
- In intrinsic-library.cpp define PGMATH_USE_XX macro callbacks in order to capture function pointers to pgmath functions as well as a description of their type. This will be used for constant folding using pgmath.
- Change atan/atan2 handling to use atan2 instead of atan when there are two

arguments  because it is easier to handle in the runtime description.

Also fixes lipgmath linking regression after D78215 <https://reviews.llvm.org/D78215> cmake changes.

This change is motivated by the need to use a similar pgmath
description in lowering. The difference is that no function pointers will
be taken there, and instead only the function name and type are needed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83051

Files:
  flang/lib/Evaluate/CMakeLists.txt
  flang/lib/Evaluate/fold-real.cpp
  flang/lib/Evaluate/intrinsics-library.cpp
  flang/runtime/pgmath.h.inc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83051.275116.patch
Type: text/x-patch
Size: 37554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20200702/05e9164a/attachment-0001.bin>


More information about the flang-commits mailing list