[PATCH] D80450: [CUDA][HIP] Fix HD function resolution

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 1 13:02:49 PST 2020


tra accepted this revision.
tra added a comment.

LGTM.

I'd suggest adding more details on the background of this change to the commit log (point to the comment in the `isBetterOverloadCandidate` ?) and outline the intention to enable the new way to do overloading after some soak time.

Also,  naming. `-ffix-overload-resolution` is rather non-specific. I didn't mean to use it literally. The problem is that I can't think of a good descriptive name for what we do here. `-fgpu-fix-wrong-side-overloads` ? Something else?



================
Comment at: clang/lib/Sema/SemaOverload.cpp:9621
+  // is never shown up here. The worst preference shown up here is 'wrong side',
+  // e.g. a host function called by a device host function in device
+  // compilation. This is valid AST as long as the host device function is not
----------------
The comment uses device/host for both function attributes and when it refers to the compilation phase. It would help to make it more readable if function attributes would be distinct from compilation phase. E.g. by using `__host__ __device__` or `HD`. 


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

https://reviews.llvm.org/D80450



More information about the cfe-commits mailing list