[llvm] [flang] [compiler-rt] [clang] [clang-tools-extra] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

Florian Hahn via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 28 12:04:19 PST 2024


================
@@ -8999,6 +8963,18 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
         LinkVPBB->insert(FMulRecipe, CurrentLink->getIterator());
         VecOp = FMulRecipe;
       } else {
+        auto *Blend = dyn_cast<VPBlendRecipe>(CurrentLink);
+        if (PhiR->isInLoop() && Blend) {
+          assert(Blend->getNumIncomingValues() == 2);
+          assert(any_of(Blend->operands(),
+                        [PhiR](VPValue *Op) { return Op == PhiR; }));
+          if (Blend->getIncomingValue(0) == PhiR)
+            Blend->replaceAllUsesWith(Blend->getIncomingValue(1));
+          else
----------------
fhahn wrote:

done, thanks!

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


More information about the cfe-commits mailing list