[llvm] [VPlan] Consistently use (Part, 0) for first lane scalar values (PR #80271)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 15:52:41 PST 2024


================
@@ -334,6 +334,13 @@ Value *VPTransformState::get(VPValue *Def, unsigned Part) {
   return VectorValue;
 }
 
+Value *VPTransformState::get(VPValue *Def, unsigned Part,
+                             unsigned NeedsScalar) {
----------------
ayalz wrote:

There's a slight redundancy when a vector is needed - either pass `false` or call get(Def, Part).
Perhaps worth extending get(Def, Part) to accept an optional `bool NeedsScalar = false`, and have it redirect to return get(Def, VPIteration(Part, 0))?

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


More information about the llvm-commits mailing list