[llvm] [Matrix] Propagate shape information through PHI insts (PR #141681)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 09:46:25 PDT 2025


================
@@ -561,6 +590,27 @@ class LowerMatrixIntrinsics {
       MatrixVal = M.embedInVector(Builder);
     }
 
+    // If it's a PHI, split it now. We'll take care of fixing up the operands
+    // later once we're in VisitPHI.
+    if (auto *PHI = dyn_cast<PHINode>(MatrixVal)) {
----------------
fhahn wrote:

Ah I see. That isn't the case with the current tests I think, but could be if we have phis with other phis as incoming value, as we process instructions in reverse post-order?

If we just process them like other instructions, we might have to create more emedding/extract code, but we would still split the phis, so the embed/extract code should be trivially fold-able by instcombine?

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


More information about the llvm-commits mailing list