[PATCH] D71179: [OpenMP][WIP] Initial support for `begin/end declare variant`

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 8 18:21:07 PST 2019


jdoerfert added a comment.

In D71179#1774444 <https://reviews.llvm.org/D71179#1774444>, @ABataev wrote:

> I read the spec and don't think that we need all this complex stuff for the implementation. Yiu need judt to check at the codegen phase if the function must be emitted or not. We don't even need to move context checksnfrom codegen, because with the current semantics all the checkscan be safely performed at the codegen phase.


For better or worse we need this and it is actually a natural reuse of the multi-versioning code. We need this because:

1. For the begin/end version we cannot even parse anything in a context that does not match at encounter time, e.g. the `kind(fpga)` context in `clang/test/AST/ast-dump-openmp-begin-declare-variant.c`.
2. For the 5.0 version we cannot use the `replaceAllUses` approach currently implemented in `tryEmitDeclareVariant` as soon as we have the construct context selector trait. That means we will have to resolve the call target earlier anyway.

(FWIW, I wrote this part of the SPEC.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71179/new/

https://reviews.llvm.org/D71179





More information about the cfe-commits mailing list