Skip to content

Commit 6e82fc5

Browse files
committed
Return reference from getVecOpXInfo
1 parent d0c0343 commit 6e82fc5

File tree

1 file changed

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

1 file changed

+7
-9
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,10 +2508,8 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
25082508
WrapFlagsTy(MulAcc->hasNoUnsignedWrap(), MulAcc->hasNoSignedWrap()),
25092509
MulAcc->getDebugLoc()),
25102510
ResultTy(MulAcc->getResultType()),
2511-
IsPartialReduction(MulAcc->isPartialReduction()) {
2512-
VecOpInfo[0] = MulAcc->getVecOp0Info();
2513-
VecOpInfo[1] = MulAcc->getVecOp1Info();
2514-
}
2511+
IsPartialReduction(MulAcc->isPartialReduction()),
2512+
VecOpInfo{MulAcc->getVecOp0Info(), MulAcc->getVecOp1Info()} {}
25152513

25162514
public:
25172515
VPMulAccumulateReductionRecipe(VPReductionRecipe *R, VPWidenRecipe *Mul,
@@ -2524,13 +2522,13 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
25242522
WrapFlagsTy(Mul->hasNoUnsignedWrap(), Mul->hasNoSignedWrap()),
25252523
R->getDebugLoc()),
25262524
ResultTy(ResultTy),
2527-
IsPartialReduction(isa<VPPartialReductionRecipe>(R)) {
2525+
IsPartialReduction(isa<VPPartialReductionRecipe>(R)),
2526+
VecOpInfo{{Ext0->getOpcode(), Ext0->isNonNeg()},
2527+
{Ext1->getOpcode(), Ext1->isNonNeg()}} {
25282528
assert(RecurrenceDescriptor::getOpcode(getRecurrenceKind()) ==
25292529
Instruction::Add &&
25302530
"The reduction instruction in MulAccumulateteReductionRecipe must "
25312531
"be Add");
2532-
VecOpInfo[0] = {Ext0->getOpcode(), Ext0->isNonNeg()};
2533-
VecOpInfo[1] = {Ext1->getOpcode(), Ext1->isNonNeg()};
25342532
}
25352533

25362534
VPMulAccumulateReductionRecipe(VPReductionRecipe *R, VPWidenRecipe *Mul)
@@ -2597,8 +2595,8 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
25972595
/// Return if the operands of mul instruction come from same extend.
25982596
bool isSameExtendVal() const { return getVecOp0() == getVecOp1(); }
25992597

2600-
VecOperandInfo getVecOp0Info() const { return VecOpInfo[0]; }
2601-
VecOperandInfo getVecOp1Info() const { return VecOpInfo[1]; }
2598+
const VecOperandInfo &getVecOp0Info() const { return VecOpInfo[0]; }
2599+
const VecOperandInfo &getVecOp1Info() const { return VecOpInfo[1]; }
26022600

26032601
/// Return if the underlying reduction recipe is a partial reduction.
26042602
bool isPartialReduction() const { return IsPartialReduction; }

0 commit comments

Comments
 (0)