[llvm] [AMDGPU] Add a feature for VOP3PX2 instructions incrementing VA_VDST twice (PR #202613)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 9 06:51:58 PDT 2026
https://github.com/jayfoad created https://github.com/llvm/llvm-project/pull/202613
None
>From 0dabbabc9f7e7c2e800b0eef26179ca144793b7a Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Tue, 9 Jun 2026 14:44:38 +0100
Subject: [PATCH] [AMDGPU] Add a feature for VOP3PX2 instructions incrementing
VA_VDST twice
---
llvm/lib/Target/AMDGPU/AMDGPU.td | 6 ++++++
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index 2d014be12cad7..db375bc8803a1 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -1403,6 +1403,10 @@ def FeatureUseAddPC64Inst : SubtargetFeature<"use-add-pc64-inst",
"Use s_add_pc_i64 instruction."
>;
+defm VOP3PX2IncrementsVaVdstTwice : AMDGPUSubtargetFeature<"vop3px2-increments-va-vdst-twice",
+ "VOP3PX2 encoded instructions increment the VaVdst counter twice", GenPredicate=false
+>;
+
//===----------------------------------------------------------------------===//
class GCNSubtargetFeatureGeneration <string Value,
@@ -2190,6 +2194,7 @@ def FeatureISAVersion12_50_Common : FeatureSet<
def FeatureISAVersion12_50 : FeatureSet<
!listconcat(FeatureISAVersion12_50_Common.Features,
[FeatureAddressableLocalMemorySize327680,
+ FeatureVOP3PX2IncrementsVaVdstTwice,
FeatureSetregVGPRMSBFixup,
FeatureCubeInsts,
FeatureLerpInst,
@@ -2207,6 +2212,7 @@ def FeatureISAVersion12_50 : FeatureSet<
def FeatureISAVersion12_51 : FeatureSet<
!listconcat(FeatureISAVersion12_50_Common.Features,
[FeatureAddressableLocalMemorySize327680,
+ FeatureVOP3PX2IncrementsVaVdstTwice,
FeatureDPALU_DPP,
FeatureCubeInsts,
FeatureLerpInst,
diff --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index 7241c0db726ce..0839c6936c15e 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -1127,7 +1127,8 @@ void WaitcntBrackets::updateByEvent(WaitEventType E, MachineInstr &Inst) {
unsigned UB = getScoreUB(T);
unsigned Increment = 1;
- if (T == AMDGPU::VA_VDST && AMDGPU::getHasMatrixScale(Inst.getOpcode())) {
+ if (T == AMDGPU::VA_VDST && AMDGPU::getHasMatrixScale(Inst.getOpcode()) &&
+ Context->ST.hasVOP3PX2IncrementsVaVdstTwice()) {
// V_WMMA_SCALE instructions use VOP3PX2 encoding. Hardware treats this as
// two VOP3P instructions and increments VA_VDST twice.
Increment = 2;
More information about the llvm-commits
mailing list