This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add runtime interface for SYSTEM_CLOCK
ClosedPublic

Authored by rovka on Jun 24 2021, 5:32 AM.

Details

Summary

SYSTEM_CLOCK may take up to 3 optional parameters, all of which are
INTENT(OUT). The COUNT and COUNT_MAX parameters are integer scalars,
while COUNT_RATE may be a real or integer scalar.

This patch breaks up the interface into 3 different functions, one for
each parameter. All 3 return integers. It is up to lowering to convert
the results to the preferred type.

Diff Detail

Event Timeline

rovka created this revision.Jun 24 2021, 5:32 AM
rovka requested review of this revision.Jun 24 2021, 5:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2021, 5:32 AM

SYSTEM_CLOCK is a mess. Its arguments are defined as integer and real, but not *default* integer or real, so there could be 80 different ways to call it in practice.

I think the runtime API should be broken up into three distinct APIs, one for each optional argument, and defined as functions returning 64-bit integers. Lowering can convert the results.

rovka updated this revision to Diff 354812.Jun 28 2021, 2:08 AM
rovka edited the summary of this revision. (Show Details)

Split into 3 functions.

klausler accepted this revision.Jun 28 2021, 10:38 AM
This revision is now accepted and ready to land.Jun 28 2021, 10:38 AM
This revision was automatically updated to reflect the committed changes.