This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Add NoSync attributes to alloc / free shared RTL calls
ClosedPublic

Authored by jhuber6 on Sep 17 2021, 12:29 PM.

Details

Summary

This patch adds the nosync attribute to the __kmpc_alloc_shared and
__kmpc_free_shared runtime library calls. This allows code analysis to
know that these functins dont contain any barriers. This will help
optimizations reason about the CFG of blocks containing these calls.

Diff Detail

Event Timeline

jhuber6 created this revision.Sep 17 2021, 12:29 PM
jhuber6 requested review of this revision.Sep 17 2021, 12:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2021, 12:29 PM
jdoerfert accepted this revision.Sep 17 2021, 12:35 PM

This patch adds the nosync attribute to the kmpc_alloc_shared and
kmpc_free_shared runtime library calls. This allows code analysis to
know that these functins dont contain any barriers. This will help
optimizations reason about the CFG of blocks containing these calls.

Technically they do contain synchronization events but neither the user nor we use them to synchronize
things not inside the functions. So, from the outside perspective they are nosync.

LG

This revision is now accepted and ready to land.Sep 17 2021, 12:35 PM
xbolva00 added inline comments.
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
545

AttributeSet()?

jhuber6 added inline comments.Sep 17 2021, 12:45 PM
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
545

We want this without optimistic attributes set. Optimistic attributes will be the default soon anyway.