[flang-commits] [flang] [flang][cuda] Prefer valid intrinsics over host-only generics in device code (PR #205376)
Zhen Wang via flang-commits
flang-commits at lists.llvm.org
Tue Jun 23 13:55:02 PDT 2026
================
@@ -3320,6 +3345,18 @@ auto ExpressionAnalyzer::GetCalleeAndArguments(const parser::Name &name,
resolution = result.specific;
dueToAmbiguity = result.failedDueToAmbiguity;
tried = std::move(result.tried);
+ if (IsCudaDeviceIntrinsicShadowedByHostProcedure(
+ name.source, context_, resolution, isSubroutine)) {
+ ActualArguments localArguments{arguments};
+ if (std::optional<SpecificCall> specificCall{context_.intrinsics().Probe(
+ CallCharacteristics{name.source.ToString(), isSubroutine},
+ localArguments, GetFoldingContext())}) {
+ CheckBadExplicitType(*specificCall, *symbol);
+ return CalleeAndArguments{
+ ProcedureDesignator{std::move(specificCall->specificIntrinsic)},
+ std::move(specificCall->arguments)};
+ }
+ }
----------------
wangzpgi wrote:
I added a explicit CUDA feature guard.
https://github.com/llvm/llvm-project/pull/205376
More information about the flang-commits
mailing list