Skip to content

Commit fca5a28

Browse files
committed
Address comments.
1 parent a0515c3 commit fca5a28

File tree

1 file changed

+11
-9
lines changed
  • llvm/lib/Transforms/Vectorize

1 file changed

+11
-9
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2626,6 +2626,7 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
26262626
ExtRed->isOrdered(), ExtRed->getDebugLoc()),
26272627
ExtOp(ExtRed->getExtOpcode()), ResultTy(ExtRed->getResultType()) {
26282628
transferFlags(*ExtRed);
2629+
setUnderlyingValue(ExtRed->getUnderlyingValue());
26292630
}
26302631

26312632
public:
@@ -2671,11 +2672,11 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
26712672
Instruction::CastOps getExtOpcode() const { return ExtOp; }
26722673
};
26732674

2674-
/// A recipe to represent inloop MulAccumulateReduction operations, performing a
2675-
/// reduction.add on the result of vector operands (might be extended)
2676-
/// multiplication into a scalar value, and adding the result to a chain. This
2677-
/// recipe is abstract and needs to be lowered to concrete recipes before
2678-
/// codegen. The operands are {ChainOp, VecOp1, VecOp2, [Condition]}.
2675+
/// A recipe to represent inloop MulAccumulateReduction operations, multiplying
2676+
/// the vector operands (which may be extended), performing a reduction.add on
2677+
/// the result, and adding the scalar result to a chain. This recipe is abstract
2678+
/// and needs to be lowered to concrete recipes before codegen. The operands are
2679+
/// {ChainOp, VecOp1, VecOp2, [Condition]}.
26792680
class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
26802681
/// Opcode of the extend for VecOp1 and VecOp2.
26812682
Instruction::CastOps ExtOp;
@@ -2695,7 +2696,10 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
26952696
WrapFlagsTy(MulAcc->hasNoUnsignedWrap(), MulAcc->hasNoSignedWrap()),
26962697
MulAcc->getDebugLoc()),
26972698
ExtOp(MulAcc->getExtOpcode()), IsNonNeg(MulAcc->isNonNeg()),
2698-
ResultTy(MulAcc->getResultType()) {}
2699+
ResultTy(MulAcc->getResultType()) {
2700+
transferFlags(*MulAcc);
2701+
setUnderlyingValue(MulAcc->getUnderlyingValue());
2702+
}
26992703

27002704
public:
27012705
VPMulAccumulateReductionRecipe(VPReductionRecipe *R, VPWidenRecipe *Mul,
@@ -2740,9 +2744,7 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
27402744
~VPMulAccumulateReductionRecipe() override = default;
27412745

27422746
VPMulAccumulateReductionRecipe *clone() override {
2743-
auto *Copy = new VPMulAccumulateReductionRecipe(this);
2744-
Copy->transferFlags(*this);
2745-
return Copy;
2747+
return new VPMulAccumulateReductionRecipe(this);
27462748
}
27472749

27482750
VP_CLASSOF_IMPL(VPDef::VPMulAccumulateReductionSC);

0 commit comments

Comments
 (0)