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

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 24 08:01:16 PDT 2019


yaxunl added a comment.

In D67837#1679670 <https://reviews.llvm.org/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 function, we do not want to diagnose it unless we are sure the host func is to be emitted.

whether a func is emitted is determined by IsKnownEmitted function. HIP and OpenMP each has its own copy.

In this case, HIP thinks a static host func is not sure to be emitted, unless it has an external linkage.

However, OpenMP thinks a static host func is always emitted.

If we do not consolidate IsKnownEmitted function of HIP and OpenMP, and use the current fix, for HIP, some additional diagnostics will be emitted compared to without -fopenmp in certain cases.

It seems I should figure out whether the static host func is really emitted for HIP then consolidate IsKnownEmitted func for HIP and OpenMP.


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

https://reviews.llvm.org/D67837





More information about the cfe-commits mailing list