This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix `omp_get_wtime` function being marked incorrectly as readonly
ClosedPublic

Authored by jhuber6 on Sep 6 2022, 8:25 AM.

Details

Summary

OpenMP has a list of of optimistic attributes that can be attached to
known runtime functions to aid some analysis. The omp_get_wtime
function incorrectly used the readonly attribute. This is not correct
at the omp_get_wtime function changes values depending on some
external state. This is more correctly modeled with
inaccessiblememonly meaning that the value does not depend on anything
within the module, but can not be removes as it depends on external
state.

Fixes #57578

Diff Detail

Event Timeline

jhuber6 created this revision.Sep 6 2022, 8:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 6 2022, 8:25 AM
jhuber6 requested review of this revision.Sep 6 2022, 8:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 6 2022, 8:25 AM
tianshilei1992 accepted this revision.Sep 6 2022, 8:27 AM

LG. That should be the issue introduced by my previous patch.

This revision is now accepted and ready to land.Sep 6 2022, 8:27 AM
fhahn added a subscriber: fhahn.Sep 6 2022, 9:23 AM

Looks like LLVM :: Transforms/OpenMP/add_attributes.ll needs updating.

jhuber6 updated this revision to Diff 458187.Sep 6 2022, 9:24 AM

Fixing test