[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-15 Thread Chi Chun Chen via Phabricator via cfe-commits
cchen updated this revision to Diff 372843. cchen added a comment. Add tests and fix coding style Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109635/new/ https://reviews.llvm.org/D109635 Files: clang/include/clang/AST/OpenMPClause.h clang/li

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-14 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. Great! This should work. Though we need actual tests ;) I also provided you with two minor edits below to make it easier to read, no functional change though. Comment at: clang/lib/Sema/SemaOpenMP.cpp:737-738 +if (ScopeEntry) + std::copy(Tr

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-14 Thread Chi Chun Chen via Phabricator via cfe-commits
cchen added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:746 +} + } + } jdoerfert wrote: > jdoerfert wrote: > > So, SmalVector has a pop_back_val which we could use to verify the > > properties are the ones we expect. However, we woul

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-14 Thread Chi Chun Chen via Phabricator via cfe-commits
cchen updated this revision to Diff 372584. cchen added a comment. Fix based on suggestions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109635/new/ https://reviews.llvm.org/D109635 Files: clang/include/clang/AST/OpenMPClause.h clang/lib/AST/

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-14 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:746 +} + } + } jdoerfert wrote: > So, SmalVector has a pop_back_val which we could use to verify the properties > are the ones we expect. However, we would need to first put

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-14 Thread Chi Chun Chen via Phabricator via cfe-commits
cchen updated this revision to Diff 372531. cchen added a comment. Remove braces Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109635/new/ https://reviews.llvm.org/D109635 Files: clang/include/clang/AST/OpenMPClause.h clang/lib/AST/OpenMPClaus

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-14 Thread Chi Chun Chen via Phabricator via cfe-commits
cchen updated this revision to Diff 372529. cchen added a comment. Fix based on feedback (wait for comment about moving ConstructTrait to IRBuilder) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109635/new/ https://reviews.llvm.org/D109635 Files:

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-13 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments. Comment at: clang/lib/AST/OpenMPClause.cpp:2488 +addTrait(Property); + } } Nit: no braces. Comment at: clang/lib/Parse/ParseOpenMP.cpp:2052 +/* CurrentFunctionDecl */ nullptr, +/* Construct

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-13 Thread Chi Chun Chen via Phabricator via cfe-commits
cchen updated this revision to Diff 372347. cchen added a comment. Rebase and fix based on suggestions Haven't ConstructTrait to IRBuilder Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109635/new/ https://reviews.llvm.org/D109635 Files: clang/i

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-13 Thread Chi Chun Chen via Phabricator via cfe-commits
cchen added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:737 + } + void eraseConstructTrait() { ConstructTraits.clear(); } + cchen wrote: > jdoerfert wrote: > > Modification was made to make it clear what happens but now I think this is > > not n

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-13 Thread Chi Chun Chen via Phabricator via cfe-commits
cchen added a comment. > One thing I wanted to do though is keep track of the constructs in the > OpenMPIRBuilder instead. So move the > > /// Vector of declare variant construct traits. > SmallVector ConstructTraits; > > into OpenMPIRBuilder and add/delete the things there. It's not a concep

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-10 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. Cool! We certainly need more tests but the design you came up with is certainly nicer than what I had in mind. One thing I wanted to do though is keep track of the constructs in the OpenMPIRBuilder instead. So move the /// Vector of declare variant construct traits

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-10 Thread Chi Chun Chen via Phabricator via cfe-commits
cchen added inline comments. Comment at: clang/test/OpenMP/declare_variant_construct_codegen_1.c:23 +#define N 100 + +void p_vxv(int *v1, int *v2, int *v3, int n); This test is from sollve test suite: https://github.com/SOLLVE/sollve_vv/blob/master/tests/5.0/dec

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-10 Thread Chi Chun Chen via Phabricator via cfe-commits
cchen added inline comments. Comment at: clang/lib/AST/OpenMPClause.cpp:2346 - VMI.ConstructTraits.push_back(Selector.Properties.front().Kind); + // VMI.ConstructTraits.push_back(Selector.Properties.front().Kind); } I'm now removing this line sin

[PATCH] D109635: [WIP][OpenMP] Support construct trait set for Clang

2021-09-10 Thread Chi Chun Chen via Phabricator via cfe-commits
cchen created this revision. cchen added a reviewer: jdoerfert. Herald added subscribers: guansong, yaxunl. cchen requested review of this revision. Herald added subscribers: cfe-commits, sstefan1. Herald added a project: clang. This patch supports construct trait set selector by using the existed