[llvm] [LV] Support interleaving with conditional scalar assignments (PR #184099)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 08:51:03 PST 2026


================
@@ -437,6 +441,17 @@ void UnrollState::unrollBlock(VPBlockBase *VPB) {
       continue;
     }
 
+    VPValue *Op2;
+    if (match(&R, m_ExtractLastActive(m_VPValue(), m_VPValue(Op1),
+                                      m_VPValue(Op2)))) {
+      addUniformForAllParts(cast<VPInstruction>(&R));
+      for (unsigned Part = 1; Part != UF; ++Part) {
+        R.addOperand(getValueForPart(Op1, Part));
+        R.addOperand(getValueForPart(Op2, Part));
+      }
+      continue;
+    }
----------------
MacDue wrote:

I think the idea is nice :+1: I'm not sure it'll work that well for `VPInstructions` though. Some use the generic unrolling and some are special cased here, but maybe there's some API that'd work well. 

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


More information about the llvm-commits mailing list