[llvm-branch-commits] [llvm] [AMDGPU] Support Wave Reduction for i16 types - 3 (PR #194812)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Apr 30 08:54:28 PDT 2026


================
@@ -6894,14 +6904,26 @@ SITargetLowering::EmitInstrWithCustomInserter(MachineInstr &MI,
                            ST.getGeneration() >= AMDGPUSubtarget::GFX12
                                ? AMDGPU::V_ADD_F64_pseudo_e64
                                : AMDGPU::V_ADD_F64_e64);
+  case AMDGPU::WAVE_REDUCE_AND_PSEUDO_B16:
+    return lowerWaveReduce(MI, *BB, *getSubtarget(),
+                           ST.hasTrue16BitInsts() ? AMDGPU::V_AND_B16_fake16_e64
+                                                  : AMDGPU::S_AND_B32);
   case AMDGPU::WAVE_REDUCE_AND_PSEUDO_B32:
     return lowerWaveReduce(MI, *BB, *getSubtarget(), AMDGPU::S_AND_B32);
   case AMDGPU::WAVE_REDUCE_AND_PSEUDO_B64:
     return lowerWaveReduce(MI, *BB, *getSubtarget(), AMDGPU::S_AND_B64);
+  case AMDGPU::WAVE_REDUCE_OR_PSEUDO_B16:
+    return lowerWaveReduce(MI, *BB, *getSubtarget(),
+                           ST.hasTrue16BitInsts() ? AMDGPU::V_OR_B16_fake16_e64
----------------
arsenm wrote:

I don't understand this being VALU instruction vs. SALU instruction. If you can use the SALU instruction, you always use the SALU instruction 

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


More information about the llvm-branch-commits mailing list