[TEST ONLY][CUDA][HIP] Defer diagnostics for unused implicit H+D functions - #3066
Closed
yxsamliu wants to merge 1 commit into
Closed
Conversation
yxsamliu
force-pushed
the
amd/dev/yaxunl/implicit-hd-defer-unused-device-diags-dev
branch
from
June 25, 2026 17:57
cdec34a to
8da2324
Compare
yxsamliu
requested review from
b-sumner,
chinmaydd,
david-salinas and
lamb-j
as code owners
June 25, 2026 17:57
yxsamliu
force-pushed
the
amd/dev/yaxunl/implicit-hd-defer-unused-device-diags-dev
branch
from
June 26, 2026 17:02
8da2324 to
2feefb5
Compare
Author
|
The remaining CI failures look unrelated to this PR. The compiler builds and the relevant tests passed. The only failures are gfx94X rocprim/hipcub/rocsparse package tests, which do not seem related to this HIP diagnostic change. |
Implicit H+D attributes are usually added to host functions by speculative, optimistic heuristics. For example, constexpr functions are implicitly marked H+D assuming they only call other constexpr functions and therefore work on both host and device. In practice, a constexpr function can still call a non-constexpr host function on a runtime path, which makes that body unusable for device code. A recent PR fixed this for implicit H+D functions forced by explicit instantiation: defer device diagnostics until end of TU, then either emit them for an organic device caller or discard them and use the trap-body fallback if CodeGen still needs a device symbol. The same reasoning applies to any implicit H+D function. The device side is speculative until real device code reaches it, so defer these diagnostics generally. This avoids rejecting host-only uses while preserving diagnostics for real device callers.
yxsamliu
force-pushed
the
amd/dev/yaxunl/implicit-hd-defer-unused-device-diags-dev
branch
from
July 8, 2026 18:40
2feefb5 to
ceaed6c
Compare
Author
|
Closing this old test-only PR. The remaining CI failures appear unrelated, and we are not using this PR for the current work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test-only ROCm amd-staging PR for llvm#205828.
The amd-staging base already includes the prerequisite upstream change:
This branch contains the generic follow-up: