[llvm] [LLVM][VPlan] Pick more optimal initial value for VPBlend. (PR #104019)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 16:31:40 PDT 2024


================
@@ -918,6 +918,16 @@ static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
     // value with the others blended into it.
 
     unsigned StartIndex = 0;
+    for (unsigned I = 0; I != Blend->getNumIncomingValues(); ++I) {
+      // If a value's mask is only used by the blend then is can be deadcoded.
+      // TODO: Find the most expensive mask that can be deadcoded.
+      VPValue *Mask = Blend->getMask(I);
+      if (Mask->getNumUsers() == 1 && !match(Mask, m_False())) {
----------------
ayalz wrote:

Suggest to remove all masked-off operands when starting to deal with Blend, so the rest can focus only on the rest. Independent of this patch.

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


More information about the llvm-commits mailing list