[PATCH] D91980: [OpenMP] Add initial support for `omp [begin/end] assumes`

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 10:06:22 PST 2020


jdoerfert created this revision.
jdoerfert added reviewers: JonChesterfield, aaron.ballman, jhuber6, grokos, ggeorgakoudis, ABataev.
Herald added subscribers: llvm-commits, guansong, bollu, yaxunl.
Herald added projects: clang, LLVM.
jdoerfert requested review of this revision.
Herald added a subscriber: sstefan1.

The `assumes` directive is an OpenMP 5.1 feature that allows the user to
provide assumptions to the optimizer. Assumptions can refer to
directives (`absent` and `contains` clauses), expressions (`holds`
clause), or generic properties (`no_openmp_routines`, `ext_ABCD`, ...).

The `assumes` spelling is used for assumptions in the global scope while
`assume` is used for executable contexts with an associated structured
block.

This patch only implements the global spellings. While clauses with
arguments are "accepted" by the parser, they will simply be ignored for
now. The implementation lowers the assumptions directly to the
`AssumptionAttr`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91980

Files:
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Parse/Parser.h
  clang/include/clang/Sema/Sema.h
  clang/lib/Parse/ParseOpenMP.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaOpenMP.cpp
  clang/test/OpenMP/assumes_codegen.cpp
  clang/test/OpenMP/assumes_include_nvptx.cpp
  clang/test/OpenMP/assumes_messages.c
  clang/test/OpenMP/assumes_print.cpp
  llvm/include/llvm/Frontend/OpenMP/OMP.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91980.307115.patch
Type: text/x-patch
Size: 39261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201123/63050e4d/attachment-0001.bin>


More information about the cfe-commits mailing list