[llvm] [LoopVectorizer] Propagate underlying instruction to the cloned instances of VPPartialReductionRecipes (PR #123638)

Nicholas Guy via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 08:03:10 PST 2025


https://github.com/NickGuy-Arm created https://github.com/llvm/llvm-project/pull/123638

None

>From cf56562067124201a9150b10c7d6eb5f9f6c1a25 Mon Sep 17 00:00:00 2001
From: Nick Guy <nicholas.guy at arm.com>
Date: Mon, 20 Jan 2025 16:01:18 +0000
Subject: [PATCH] [LoopVectorizer] Propagate underlying instruction to the
 cloned instances of VPPartialReductionRecipes

---
 llvm/lib/Transforms/Vectorize/VPlan.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 87f87bf1437196..9d8136a0ebf57d 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -2459,7 +2459,8 @@ class VPPartialReductionRecipe : public VPSingleDefRecipe {
   ~VPPartialReductionRecipe() override = default;
 
   VPPartialReductionRecipe *clone() override {
-    return new VPPartialReductionRecipe(Opcode, getOperand(0), getOperand(1));
+    return new VPPartialReductionRecipe(Opcode, getOperand(0), getOperand(1),
+       getUnderlyingInstr());
   }
 
   VP_CLASSOF_IMPL(VPDef::VPPartialReductionSC)



More information about the llvm-commits mailing list