forked from OSchip/llvm-project
acb6f80d96
This patch implements correct hostness based overloading resolution in isBetterOverloadCandidate. Based on hostness, if one candidate is emittable whereas the other candidate is not emittable, the emittable candidate is better. If both candidates are emittable, or neither is emittable based on hostness, then other rules should be used to determine which is better. This is because hostness based overloading resolution is mostly for determining viability of a function. If two functions are both viable, other factors should take precedence in preference. If other rules cannot determine which is better, CUDA preference will be used again to determine which is better. However, correct hostness based overloading resolution requires overloading resolution diagnostics to be deferred, which is not on by default. The rationale is that deferring overloading resolution diagnostics may hide overloading reslolutions issues in header files. An option -fgpu-exclude-wrong-side-overloads is added, which is off by default. When -fgpu-exclude-wrong-side-overloads is off, keep the original behavior, that is, exclude wrong side overloads only if there are same side overloads. This may result in incorrect overloading resolution when there are no same side candates, but is sufficient for most CUDA/HIP applications. When -fgpu-exclude-wrong-side-overloads is on, enable deferring overloading resolution diagnostics and enable correct hostness based overloading resolution, i.e., always exclude wrong side overloads. Differential Revision: https://reviews.llvm.org/D80450 |
||
---|---|---|
.. | ||
Inputs | ||
add-inline-in-definition.cu | ||
addr-of-overloaded-fn.cu | ||
alias.cu | ||
amdgpu-attrs.cu | ||
amdgpu-f128.cu | ||
amdgpu-size_t.cu | ||
amdgpu-windows-vectorcall.cu | ||
asm-constraints-device.cu | ||
asm-constraints-mixed.cu | ||
asm_delayed_diags.cu | ||
attr-declspec.cu | ||
attributes-on-non-cuda.cu | ||
autoret-global.cu | ||
bad-attributes.cu | ||
bad-calls-on-same-line.cu | ||
builtins.cu | ||
call-device-fn-from-host.cu | ||
call-host-fn-from-device.cu | ||
call-kernel-from-kernel.cu | ||
call-stack-for-deferred-err.cu | ||
config-type.cu | ||
constexpr-ctor.cu | ||
constexpr-variables.cu | ||
cuda-builtin-vars.cu | ||
cuda-inherits-calling-conv.cu | ||
cxx11-kernel-call.cu | ||
default-ctor.cu | ||
deferred-diags-limit.cu | ||
deferred-diags.cu | ||
deferred-oeverload.cu | ||
device-use-host-var.cu | ||
device-var-init.cu | ||
error-includes-mode.cu | ||
exceptions.cu | ||
extern-shared.cu | ||
float16.cu | ||
function-overload.cu | ||
function-target.cu | ||
function-template-overload.cu | ||
global-initializers-host.cu | ||
gnu-inline.cu | ||
host-device-constexpr.cu | ||
implicit-copy.cu | ||
implicit-device-lambda.cu | ||
implicit-intrinsic.cu | ||
implicit-member-target-collision-cxx11.cu | ||
implicit-member-target-collision.cu | ||
implicit-member-target-inherited.cu | ||
implicit-member-target.cu | ||
inherited-ctor.cu | ||
kernel-call.cu | ||
lambda.cu | ||
launch_bounds.cu | ||
lit.local.cfg | ||
method-target.cu | ||
no-call-stack-for-immediate-errs.cu | ||
no-destructor-overload.cu | ||
no-host-device-constexpr.cu | ||
openmp-static-func.cu | ||
openmp-target.cu | ||
overloaded-delete.cu | ||
pr27778.cu | ||
qualifiers.cu | ||
reference-to-kernel-fn.cu | ||
trace-through-global.cu | ||
union-init.cu | ||
usual-deallocators.cu | ||
vararg.cu | ||
vla.cu |