-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[AMDGPU][NFC] Use getScoreUB
for XCNT insertion.
#162448
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
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-backend-amdgpu Author: Aaditya (easyonaadit) ChangesFull diff: https://github.com/llvm/llvm-project/pull/162448.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index 5e27b37809c7c..6dcbced010a5a 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -1019,7 +1019,7 @@ void WaitcntBrackets::updateByEvent(WaitEventType E, MachineInstr &Inst) {
// SMEM and VMEM operations. So there will never be
// outstanding address translations for both SMEM and
// VMEM at the same time.
- setScoreLB(T, CurrScore - 1);
+ setScoreLB(T, getScoreUB(T) - 1);
PendingEvents &= ~(1 << OtherEvent);
}
for (const MachineOperand &Op : Inst.all_uses())
|
I'm not sure if we need a test here? |
This is a better way of achieving the code change that was introduced in #160812. |
@@ -1019,7 +1019,7 @@ void WaitcntBrackets::updateByEvent(WaitEventType E, MachineInstr &Inst) { | |||
// SMEM and VMEM operations. So there will never be | |||
// outstanding address translations for both SMEM and | |||
// VMEM at the same time. | |||
setScoreLB(T, CurrScore - 1); | |||
setScoreLB(T, getScoreUB(T) - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you still subtract 1? Is that required for some reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to keep exactly one pending Xcnt event.
UBScore
gets updated at the start of this function, if I use that as-is, it'll mark all xcnt events as completed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I think this is a hint that you're doing this too late, and it might work out cleaner to implement it at the end of generateWaitcntInstBefore near where we handle S_BARRIER.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- @Pierre-vh FYI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current patch seems fine anyway, since it's a tiny improvement on the status quo.
No description provided.