[llvm] [VPlan] Simplify VPBlendRecipes to select instructions (PR #133993)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 01:38:52 PDT 2025


================
@@ -1082,6 +1082,15 @@ static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
   if (match(Def, m_Select(m_VPValue(), m_VPValue(X), m_Deferred(X))))
     return Def->replaceAllUsesWith(X);
 
+  // select !c, x, y -> select c, y, x
+  VPValue *C;
+  if (match(Def, m_Select(m_Not(m_VPValue(C)), m_VPValue(X), m_VPValue(Y)))) {
+    Def->setOperand(0, C);
+    Def->setOperand(1, Y);
+    Def->setOperand(2, X);
+    return;
+  }
+
----------------
artagnon wrote:

Can this change be landed separately?

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


More information about the llvm-commits mailing list