-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[AMDGPU] Use encodeFieldVaVdst in hazard recognizer. NFCI. #153881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rampitec
merged 4 commits into
main
from
users/rampitec/08-15-_amdgpu_use_encodefieldvavdst_in_hazard_recognizer._nfci
Aug 16, 2025
Merged
[AMDGPU] Use encodeFieldVaVdst in hazard recognizer. NFCI. #153881
rampitec
merged 4 commits into
main
from
users/rampitec/08-15-_amdgpu_use_encodefieldvavdst_in_hazard_recognizer._nfci
Aug 16, 2025
Conversation
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
This was referenced Aug 15, 2025
@llvm/pr-subscribers-backend-amdgpu Author: Stanislav Mekhanoshin (rampitec) ChangesCo-authored-by: Stephen Thomas <[email protected]> Full diff: https://github.com/llvm/llvm-project/pull/153881.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
index fa3ca27a5f47c..49a681efc79c7 100644
--- a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
@@ -1749,7 +1749,7 @@ bool GCNHazardRecognizer::fixVALUPartialForwardingHazard(MachineInstr *MI) {
BuildMI(*MI->getParent(), MI, MI->getDebugLoc(),
TII.get(AMDGPU::S_WAITCNT_DEPCTR))
- .addImm(0x0fff);
+ .addImm(AMDGPU::DepCtr::encodeFieldVaVdst(0));
return true;
}
@@ -1799,7 +1799,7 @@ bool GCNHazardRecognizer::fixVALUTransUseHazard(MachineInstr *MI) {
if (SIInstrInfo::isVMEM(I) || SIInstrInfo::isDS(I) ||
SIInstrInfo::isEXP(I) ||
(I.getOpcode() == AMDGPU::S_WAITCNT_DEPCTR &&
- I.getOperand(0).getImm() == 0x0fff))
+ AMDGPU::DepCtr::decodeFieldVaVdst(I.getOperand(0).getImm()) == 0))
return HazardExpired;
// Track registers writes
|
changpeng
approved these changes
Aug 15, 2025
…t instructions This simply updates the pass's cognizance of these instructions, and for the most part the hazards where they might be encountered do not exist for gfx12. Nonetheless, encountering them has to be checked for as doing so would indicate a compiler error. Co-authored-by: Stephen Thomas <[email protected]>
Co-authored-by: Stephen Thomas <[email protected]>
2f96c40
to
df0ab0a
Compare
0c71fc2
to
4ee7e8b
Compare
Base automatically changed from
users/rampitec/08-15-_amdgpu_update_gcnhazardrecognizer_s_understanding_of_gfx12_waitcount_instructions
to
main
August 16, 2025 00:18
…vavdst_in_hazard_recognizer._nfci
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.
Co-authored-by: Stephen Thomas [email protected]