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

Aleksandar Spasojevic via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 04:47:10 PDT 2026


================
@@ -664,12 +664,17 @@ static std::optional<unsigned> evalLaneExpr(Value *V, unsigned Lane,
   if (Depth >= MaxAnalysisRecursionDepth)
     return std::nullopt;
 
-  if (isThreadID(ST, V))
-    return Lane;
+  // Poison/undef in the index expression: the shuffle result is poison
+  // regardless of which lane we evaluate.
+  if (isa<PoisonValue>(V) || isa<UndefValue>(V))
----------------
aleksandar-amd wrote:

Added poison test.

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


More information about the llvm-commits mailing list