-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[VPlan] Strip bad TODO in VPTransformState::get (NFC) #166146
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
Conversation
It's impossible to create a VPInstruction::Broadcast at this point, since we need to return an IR Value, which would only be possible after the VPInstruction is executed.
|
@llvm/pr-subscribers-vectorizers @llvm/pr-subscribers-llvm-transforms Author: Ramkumar Ramachandra (artagnon) ChangesIt's impossible to create a VPInstruction::Broadcast at this point, since we need to return an IR Value, which would only be possible after the VPInstruction is executed. Full diff: https://github.com/llvm/llvm-project/pull/166146.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 428a8f4c1348f..84c9c9c2de645 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -319,7 +319,6 @@ Value *VPTransformState::get(const VPValue *Def, bool NeedsScalar) {
// We need to construct the vector value for a single-scalar value by
// broadcasting the scalar to all lanes.
- // TODO: Replace by introducing Broadcast VPInstructions.
assert(IsSingleScalar && "must be a single-scalar at this point");
// Set the insert point after the last scalarized instruction or after the
// last PHI, if LastInst is a PHI. This ensures the insertelement sequence
|
lukel97
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.
I presume the point of that TODO is not that it should emit a VPInstruction::Broadcast at that point, but all single scalar values should be wrapped in a VPInstruction::Broadcast before execution. So VPTransformState::get should never have to emit a splat.
|
Yes, that's a good point. |
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.
I presume the point of that TODO is not that it should emit a VPInstruction::Broadcast at that point, but all single scalar values should be wrapped in a VPInstruction::Broadcast before execution. So VPTransformState::get should never have to emit a splat.
Yep, that's the intention of the TODO
Should we create a new VPTransform to wrap single-scalars in broadcasts? |
I think |
Hm, strange. I wonder why it only does it for live-ins and for the Plan's entry, and not other recipes created in VPlan. |
It's impossible to create a VPInstruction::Broadcast at this point, since we need to return an IR Value, which would only be possible after the VPInstruction is executed.