[llvm] [AMDGPU] Optimize LDS DMA soft waitcnt (PR #138802)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 6 22:12:03 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp llvm/lib/Target/AMDGPU/SIInstrInfo.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index 3e0cf5f35..7852c650a 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -1279,9 +1279,10 @@ bool WaitcntGeneratorPreGFX12::applyPreexistingWaitcnt(
unsigned IEnc = II.getOperand(0).getImm();
AMDGPU::Waitcnt OldWait = AMDGPU::decodeWaitcnt(IV, IEnc);
- // These pseudo waitcnt instructions are only needed to synchronize DS operations
- // with direct LDS loads that use vmcnt. We can safely relax them when no
- // outstanding direct LDS loads exist, even if other vmcnt events are pending.
+ // These pseudo waitcnt instructions are only needed to synchronize DS
+ // operations with direct LDS loads that use vmcnt. We can safely relax
+ // them when no outstanding direct LDS loads exist, even if other vmcnt
+ // events are pending.
if (II.getOpcode() == AMDGPU::S_WAITCNT_VMCNT_LDS_DMA_soft) {
unsigned RegNo = SQ_MAX_PGM_VGPRS + EXTRA_VGPR_LDS;
AMDGPU::Waitcnt LDSDMAWait;
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.h b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
index 8f32c5223..3980cc9c9 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
@@ -1010,7 +1010,7 @@ public:
static unsigned getNonSoftWaitcntOpcode(unsigned Opcode) {
switch (Opcode) {
case AMDGPU::S_WAITCNT_soft:
- case AMDGPU:: S_WAITCNT_VMCNT_LDS_DMA_soft:
+ case AMDGPU::S_WAITCNT_VMCNT_LDS_DMA_soft:
return AMDGPU::S_WAITCNT;
case AMDGPU::S_WAITCNT_VSCNT_soft:
return AMDGPU::S_WAITCNT_VSCNT;
``````````
</details>
https://github.com/llvm/llvm-project/pull/138802
More information about the llvm-commits
mailing list