[llvm] [AMDGPU] LiveRegOptimizer: fix PHI same-BB filter; consider i8/i16 binops on SDWA (PR #155800)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 11 00:01:52 PDT 2025


================
@@ -150,7 +184,12 @@ class LiveRegOptimizer {
       if (!CVisited.insert(CII).second)
         continue;
 
-      if (CII->getParent() == II->getParent() && !IsLookThru(II))
+      // Allow same-BB non-lookthrough users when the def is a PHI:
+      // loop headers frequently consume the carried value in the header block
+      // (e.g. byte-wise vector binops). We *do* want to coerce across the
+      // backedge in that common case to enable packed i32 + SDWA lowering.
+      if (CII->getParent() == II->getParent() && !IsLookThru(CII) &&
+          !isa<PHINode>(II))
----------------
arsenm wrote:

Can you split this into a separate PR? It's hard to see that all the cases are adequately tested when they're together 

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


More information about the llvm-commits mailing list