-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[LoopVectorizer] Propagate underlying instruction to the cloned instances of VPPartialReductionRecipes #123638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LoopVectorizer] Propagate underlying instruction to the cloned instances of VPPartialReductionRecipes #123638
Conversation
|
@llvm/pr-subscribers-llvm-transforms @llvm/pr-subscribers-vectorizers Author: Nicholas Guy (NickGuy-Arm) ChangesFull diff: https://github.com/llvm/llvm-project/pull/123638.diff 1 Files Affected:
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)
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
|
IIUC this should only change VPlan printing or is the underlying instr used by other parts of the recipe? If it's the former, I guess to could be tested by check the printed VPlan during epilogue vectorization? |
…nces of VPPartialReductionRecipes
cf56562 to
621cd7b
Compare
| ; CHECK-EMPTY: | ||
| ; CHECK-NEXT: <x1> vector loop: { | ||
| ; CHECK-NEXT: vector.body: | ||
| ; CHECK-NEXT: SCALAR-PHI vp<%0> = phi ir<0>, vp<%index.next> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use patterns to match the vp<> value numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| ; REQUIRES: asserts | ||
| ; RUN: opt -mattr=+neon,+dotprod -passes=loop-vectorize -debug-only=loop-vectorize -force-vector-interleave=1 -enable-epilogue-vectorization -epilogue-vectorization-force-VF=2 -disable-output %s 2>&1 | FileCheck %s | ||
|
|
||
| target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the test. Do we need a separate test file or could we just enable epilogue vectorization in the existing llvm/test/Transforms/LoopVectorize/AArch64/vplan-printing.ll?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I was a bit skeptical at first about merging them, but they went together with no issues.
fhahn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks
No description provided.