[llvm] [VPlan] Consistently use (Part, 0) for first lane scalar values (PR #80271)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 22 05:20:25 PST 2024
================
@@ -512,7 +513,16 @@ void VPInstruction::execute(VPTransformState &State) {
if (!hasResult())
continue;
assert(GeneratedValue && "generateInstruction must produce a value");
- State.set(this, GeneratedValue, Part);
+ if (GeneratedValue->getType()->isVectorTy()) {
+ State.set(this, GeneratedValue, Part);
+ } else {
+ // Note that ComputeReductionResult creates a scalar, but has its last
+ // lane accessed, via the generic VPLiveOut.
+ assert((getOpcode() == VPInstruction::ComputeReductionResult ||
+ State.VF.isScalar() || vputils::onlyFirstLaneUsed(this)) &&
+ "scalar value but not only first lane used");
+ State.set(this, GeneratedValue, VPIteration(Part, 0));
----------------
fhahn wrote:
updated, thanks!
https://github.com/llvm/llvm-project/pull/80271
More information about the llvm-commits
mailing list