[PATCH] D67837: [CUDA][HIP] Fix assertion in Sema::markKnownEmitted with -fopenmp

2019-09-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 221829. yaxunl edited the summary of this revision. yaxunl added a comment. Unify CUDA/HIP/OpenMP host/device check. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67837/new/ https://reviews.llvm.org/D67837 Files: include/clang/Sema/Sema.h lib/Se

[PATCH] D67837: [CUDA][HIP] Fix assertion in Sema::markKnownEmitted with -fopenmp

2019-09-24 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. If that's tractable, then that does seem like the best solution. You can commit this if you need a shorter-term fix. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67837/new/ https://reviews.llvm.org/D67837 ___ cf

[PATCH] D67837: [CUDA][HIP] Fix assertion in Sema::markKnownEmitted with -fopenmp

2019-09-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D67837#1679670 , @rjmccall wrote: > Okay. And it's okay to fall down to the code below when functions are used > in both ways this way? This part of code is for delayed checking of hostness. If a host function calls device f

[PATCH] D67837: [CUDA][HIP] Fix assertion in Sema::markKnownEmitted with -fopenmp

2019-09-23 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Okay. And it's okay to fall down to the code below when functions are used in both ways this way? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67837/new/ https://reviews.llvm.org/D67837 ___ cfe-commits mailing l

[PATCH] D67837: [CUDA][HIP] Fix assertion in Sema::markKnownEmitted with -fopenmp

2019-09-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 221341. yaxunl added a comment. revised by John's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67837/new/ https://reviews.llvm.org/D67837 Files: lib/Sema/Sema.cpp test/SemaCUDA/openmp-static-func.cu Index: test/SemaCUDA/openmp-static

[PATCH] D67837: [CUDA][HIP] Fix assertion in Sema::markKnownEmitted with -fopenmp

2019-09-20 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/Sema/Sema.cpp:1511 +if (Loc != S.DeviceCallGraph.end()) + S.DeviceCallGraph.erase(Loc); return; yaxunl wrote: > rjmccall wrote: > > There's an overload of `DenseMap::erase` that just takes a key value,

[PATCH] D67837: [CUDA][HIP] Fix assertion in Sema::markKnownEmitted with -fopenmp

2019-09-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/Sema/Sema.cpp:1511 +if (Loc != S.DeviceCallGraph.end()) + S.DeviceCallGraph.erase(Loc); return; rjmccall wrote: > There's an overload of `DenseMap::erase` that ju

[PATCH] D67837: [CUDA][HIP] Fix assertion in Sema::markKnownEmitted with -fopenmp

2019-09-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 221097. yaxunl added a comment. reuse the call tree. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67837/new/ https://reviews.llvm.org/D67837 Files: lib/Sema/Sema.cpp test/SemaCUDA/openmp-static-func.cu Index: test/SemaCUDA/openmp-static-func.

[PATCH] D67837: [CUDA][HIP] Fix assertion in Sema::markKnownEmitted with -fopenmp

2019-09-20 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/Sema/Sema.cpp:1511 +if (Loc != S.DeviceCallGraph.end()) + S.DeviceCallGraph.erase(Loc); return; There's an overload of `DenseMap::erase` that just takes a key value, so this whole thing can be `S.Devi

[PATCH] D67837: [CUDA][HIP] Fix assertion in Sema::markKnownEmitted with -fopenmp

2019-09-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. Herald added a subscriber: guansong. Herald added a reviewer: jdoerfert. Herald added a project: clang. CUDA/HIP program may be compiled with -fopenmp. In this case, -fopenmp is only passed to host compilation to take advantages