[llvm] b7ef63a - [AMDGPU] Add a feature for VALUTransUseHazard

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 6 05:50:24 PST 2023


Author: Jay Foad
Date: 2023-01-06T13:50:17Z
New Revision: b7ef63af566287c724d8883bcf715cb156a0c73f

URL: https://github.com/llvm/llvm-project/commit/b7ef63af566287c724d8883bcf715cb156a0c73f
DIFF: https://github.com/llvm/llvm-project/commit/b7ef63af566287c724d8883bcf715cb156a0c73f.diff

LOG: [AMDGPU] Add a feature for VALUTransUseHazard

NFCI. This just allows us to experiment with enabling/disabling the
workaround on different subtargets.

Differential Revision: https://reviews.llvm.org/D141121

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPU.td
    llvm/lib/Target/AMDGPU/GCNSubtarget.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index 63861a1a90527..dfe6dd7042f98 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -723,6 +723,12 @@ def FeatureVOPD : SubtargetFeature<"vopd",
   "Has VOPD dual issue wave32 instructions"
 >;
 
+def FeatureVALUTransUseHazard : SubtargetFeature<"valu-trans-use-hazard",
+  "HasVALUTransUseHazard",
+  "true",
+  "Hazard when TRANS instructions are closely followed by a use of the result"
+>;
+
 //===------------------------------------------------------------===//
 // Subtarget Features (options and debugging)
 //===------------------------------------------------------------===//
@@ -1305,6 +1311,7 @@ def FeatureISAVersion11_Common : FeatureSet<
    FeatureImageInsts,
    FeaturePackedTID,
    FeatureVcmpxPermlaneHazard,
+   FeatureVALUTransUseHazard,
    FeatureBackOffBarrier,
    FeatureMADIntraFwdBug]>;
 

diff  --git a/llvm/lib/Target/AMDGPU/GCNSubtarget.h b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
index 5ebec834b1426..ba24630cb70ec 100644
--- a/llvm/lib/Target/AMDGPU/GCNSubtarget.h
+++ b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
@@ -195,6 +195,7 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
   bool HasGFX11FullVGPRs = false;
   bool HasMADIntraFwdBug = false;
   bool HasVOPDInsts = false;
+  bool HasVALUTransUseHazard = false;
 
   // Dummy feature to use for assembler in tablegen.
   bool FeatureDisable = false;
@@ -1063,7 +1064,7 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
     return getGeneration() >= GFX11;
   }
 
-  bool hasVALUTransUseHazard() const { return getGeneration() >= GFX11; }
+  bool hasVALUTransUseHazard() const { return HasVALUTransUseHazard; }
 
   bool hasVALUMaskWriteHazard() const { return getGeneration() >= GFX11; }
 


        


More information about the llvm-commits mailing list