[all-commits] [llvm/llvm-project] 263390: [CUDA][HIP] Fix implicit HD function resolution

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Thu Jun 4 13:55:38 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 263390d4f5f23967a31af09eb6e0c12e633d6104
      https://github.com/llvm/llvm-project/commit/263390d4f5f23967a31af09eb6e0c12e633d6104
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2020-06-04 (Thu, 04 Jun 2020)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaCUDA.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/test/SemaCUDA/function-overload.cu

  Log Message:
  -----------
  [CUDA][HIP] Fix implicit HD function resolution

recommit e03394c6a6ff with fix

When implicit HD function calls a function in device compilation,
if one candidate is an implicit HD function, current resolution rule is:

D wins over HD and H
HD and H are equal

this caused regression when there is an otherwise worse D candidate

This patch changes that to

D, HD and H are all equal

The rationale is that we already know for host compilation there is already
a valid candidate in HD and H candidates that will not cause error. Allowing
HD and H gives us a fall back candidate that will not cause error. If D wins,
that means D has to be a better match otherwise, therefore D should also
be a valid candidate that will not cause error. In this way, we can guarantee
no regression.

Differential Revision: https://reviews.llvm.org/D80450




More information about the All-commits mailing list