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 { 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 +...