[PATCH] D55483: Introduce the callback attribute and emit !callback metadata

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 8 21:09:43 PST 2018


jdoerfert created this revision.
jdoerfert added reviewers: hfinkel, reames, fhahn, ABataev.
Herald added subscribers: jfb, bollu.

  With commit rXXXXX (currently https://reviews.llvm.org/D54498), LLVM
  gained the ability to apply existing optimizations on indirections
  through callbacks. This is based on an abstraction that hides the
  middle man as described in rXXXXX and the llvm::AbstractCallSite class.
  
  This commit enables clang to emit !callback metadata that is
  understood by LLVM. It does so in three different cases:
    1) For known broker functions declarations that are directly
       emitted, e.g., __kmpc_fork_call for the OpenMP pragma parallel.
    2) For known broker functions that are identified by their name and
       source location through the builtin mechanism, e.g.,
       pthread_create from the POSIX thread API.
    3) For user annotated functions that carry the "callback(idx, ...)"
       attribute. The attribute has to include the index of the callback
       callee and how the passed arguments can be identified (as many as
       the callback callee has).
  
  For additional information, also consider the commit message and
  discussion for the LLVM patch: https://reviews.llvm.org/D54498

NOTE: This is only committed after https://reviews.llvm.org/D54498 and
the commit message will be modified accordingly.


Repository:
  rC Clang

https://reviews.llvm.org/D55483

Files:
  include/clang/Basic/Attr.td
  include/clang/Basic/Builtins.def
  include/clang/Basic/Builtins.h
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Basic/Builtins.cpp
  lib/CodeGen/CGOpenMPRuntime.cpp
  lib/CodeGen/CodeGenModule.cpp
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaDeclAttr.cpp
  test/CodeGen/callback_annotated.c
  test/CodeGen/callback_openmp.c
  test/CodeGen/callback_pthread_create.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55483.177404.patch
Type: text/x-patch
Size: 15765 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181209/e605e539/attachment.bin>


More information about the cfe-commits mailing list