[PATCH] D148142: [AMDGPU] Update Subtarget isWave32 method to ignore the wave32 feature pre-gfx9

krishna chaitanya sankisa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 02:15:20 PDT 2023


skc7 updated this revision to Diff 526550.
skc7 retitled this revision from "[WIP] Check and generate 32 bit saveexec for gfx10 and above targets" to "[AMDGPU] Update Subtarget isWave32 method to ignore the wave32 feature pre-gfx9".
skc7 edited the summary of this revision.
Herald added subscribers: tpr, dstuttard, yaxunl, kzhuravl.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148142/new/

https://reviews.llvm.org/D148142

Files:
  llvm/lib/Target/AMDGPU/GCNSubtarget.h
  llvm/test/CodeGen/AMDGPU/saveexec-xor-optimize-wave32.mir


Index: llvm/test/CodeGen/AMDGPU/saveexec-xor-optimize-wave32.mir
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AMDGPU/saveexec-xor-optimize-wave32.mir
@@ -0,0 +1,23 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
+# RUN: llc -march=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize32 -run-pass=si-optimize-exec-masking -verify-machineinstrs %s -o - | FileCheck --check-prefixes=GFX10 %s
+# RUN: llc -march=amdgcn -mcpu=gfx90a -mattr=+wavefrontsize32 -run-pass=si-optimize-exec-masking -verify-machineinstrs %s -o - | FileCheck --check-prefixes=GFX9 %s
+
+---
+
+name: s_or_saveexec_xor_combine_b32
+tracksRegLiveness: true
+body: |
+  bb.0:
+    liveins: $sgpr0
+    ; GFX10-LABEL: name: s_or_saveexec_xor_combine_b32
+    ; GFX10: liveins: $sgpr0
+    ; GFX10-NEXT: {{  $}}
+    ; GFX10-NEXT: $sgpr0 = S_ANDN2_SAVEEXEC_B32 $sgpr0, implicit-def $exec, implicit-def $scc, implicit $exec
+    ; GFX9-LABEL: name: s_or_saveexec_xor_combine_b32
+    ; GFX9: liveins: $sgpr0
+    ; GFX9-NEXT: {{  $}}
+    ; GFX9-NEXT: renamable $sgpr0 = S_OR_SAVEEXEC_B32 killed renamable $sgpr0, implicit-def $exec, implicit-def $scc, implicit $exec
+    ; GFX9-NEXT: $exec_lo = S_XOR_B32 $exec_lo, renamable $sgpr0, implicit-def $scc
+    renamable $sgpr0 = S_OR_SAVEEXEC_B32 killed renamable $sgpr0, implicit-def $exec, implicit-def $scc, implicit $exec
+    $exec_lo = S_XOR_B32 $exec_lo, renamable $sgpr0, implicit-def $scc
+...
Index: llvm/lib/Target/AMDGPU/GCNSubtarget.h
===================================================================
--- llvm/lib/Target/AMDGPU/GCNSubtarget.h
+++ llvm/lib/Target/AMDGPU/GCNSubtarget.h
@@ -1307,7 +1307,9 @@
   createFillMFMAShadowMutation(const TargetInstrInfo *TII) const;
 
   bool isWave32() const {
-    return getWavefrontSize() == 32;
+    return (getGeneration() >= AMDGPUSubtarget::GFX10) &&
+           hasFeature(AMDGPU::FeatureWavefrontSize32) &&
+           (getWavefrontSize() == 32);
   }
 
   bool isWave64() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148142.526550.patch
Type: text/x-patch
Size: 2064 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230530/0a6df189/attachment.bin>


More information about the llvm-commits mailing list