[llvm] [AMDGPU][InstCombine] Optimize constant shuffle patterns (PR #192246)

Domenic Nutile via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 08:46:38 PDT 2026


================
@@ -1559,6 +1846,12 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
 
     return IC.replaceOperand(II, 0, PoisonValue::get(VDstIn->getType()));
   }
+  case Intrinsic::amdgcn_wave_shuffle: {
+    if (ST->hasDPP())
+      if (std::optional<Instruction *> R = tryWaveShuffleDPP(*ST, IC, II))
+        return R;
+    return tryOptimizeShufflePattern(IC, II, *ST);
+  }
----------------
saxlungs wrote:

I think all the cases you've added for `tryOptimizeShufflePattern` more than covers the existing ones in `tryWaveShuffleDPP` no? I feel like this PR can simply remove the existing function in favor of this more fleshed out new function

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


More information about the llvm-commits mailing list