This is an archive of the discontinued LLVM Phabricator instance.

[flang] Get ppc64le build bot back up
ClosedPublic

Authored by klausler on Apr 25 2022, 4:46 PM.

Details

Summary

A recent change assumed that the native C++ "long double" maps to
a Fortran data type; but this turns out to not be true for ppc64le,
which uses "double-double" for "long double".

This is a quick patch to get the ppc64le flang build bot back up.
A better fix that either uses HostTypeExists<> or replaces "long double"
with "ieee128_t" (or some other solution) is expected to follow soon.

Diff Detail

Event Timeline

klausler created this revision.Apr 25 2022, 4:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2022, 4:46 PM
klausler requested review of this revision.Apr 25 2022, 4:46 PM
klausler updated this revision to Diff 425082.Apr 25 2022, 5:37 PM

Remove irrelevant changes; the patch should be a simple #if/#endif exclusion on _ARCH_PPC.

The CI is complaining about a clang-format issue in flang/lib/Evaluate/intrinsics-library.cpp

jeanPerier accepted this revision.Apr 26 2022, 5:02 AM

I am surprised because the dispatching uses host::FortranType<HostT> (at [1]) to avoid making assumptions regarding what the host floating points are. So I would have expected this code to automatically map long double to REAL(16) on ppc64le, but obviously, there is a bug/issue somewhere. Thanks for the fix.

[1]: https://github.com/llvm/llvm-project/blob/e356027016c6365b3d8924f54c33e2c63d931492/flang/lib/Evaluate/intrinsics-library.cpp#L367-L375

This revision is now accepted and ready to land.Apr 26 2022, 5:02 AM

This can go in as it is. Both Clang and GCC define this macro on PPC. However, it will mean that we don't define these even for compilations with -mabi=ieeelongdouble and -mlong-double-64. If it matters that this works when long double means IEEE 754-R Quad Precision or simply double precision, you could guard it with something like the following

#if defined(__PPC__) && defined(__LONG_DOUBLE_128__) && !defined(__LONG_DOUBLE_IEEE128__)

This can go in as it is. Both Clang and GCC define this macro on PPC. However, it will mean that we don't define these even for compilations with -mabi=ieeelongdouble and -mlong-double-64. If it matters that this works when long double means IEEE 754-R Quad Precision or simply double precision, you could guard it with something like the following

#if defined(__PPC__) && defined(__LONG_DOUBLE_128__) && !defined(__LONG_DOUBLE_IEEE128__)

Will update and reformat and try again.

klausler updated this revision to Diff 425230.Apr 26 2022, 8:39 AM

Use more precise #if predicate & reformat to placate CI.

klausler updated this revision to Diff 425240.Apr 26 2022, 8:57 AM

Reverse the #if predicate, and wrap it around the whole function to avoid error from an empty array.

nemanjai accepted this revision.Apr 26 2022, 9:04 AM

LGTM. Thanks for the fix.

This revision was automatically updated to reflect the committed changes.

The ppc64l. flang build bot is now green.