[llvm] [AMDGPU] Remove wavefrontsize feature from GFX10+ (PR #98400)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 00:46:43 PDT 2024


================
@@ -105,6 +105,14 @@ GCNSubtarget::initializeSubtargetDependencies(const Triple &TT,
                                         : AMDGPUSubtarget::SOUTHERN_ISLANDS;
   }
 
+  if (!hasFeature(AMDGPU::FeatureWavefrontSize32) &&
+      !hasFeature(AMDGPU::FeatureWavefrontSize64)) {
+    if (getGeneration() >= AMDGPUSubtarget::GFX10)
+      ToggleFeature(AMDGPU::FeatureWavefrontSize32);
+    else
+      ToggleFeature(AMDGPU::FeatureWavefrontSize64);
----------------
rampitec wrote:

I.e. the line `if (getGeneration() >= AMDGPUSubtarget::GFX10)` can be changed to `if (hasFeature(AMDGPU::FeatureSupportsWave32))`, but that's it.

Also I shall mention, this `if` can be avoided altogether because subtargets without an option to select wave size just have a nailed wave64 feature in their definition. This `if` here is just to catch cases when tests use manual -mattr switching it off, but I can remove it and only set wave32 as a default.

https://github.com/llvm/llvm-project/pull/98400


More information about the llvm-commits mailing list