Skip to content

Commit 0b3e344

Browse files
committed
Private RecurrenceDescriptor and ordered bool.
1 parent 1ad4f50 commit 0b3e344

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2169,11 +2169,11 @@ class VPInterleaveRecipe : public VPRecipeBase {
21692169
/// a vector operand into a scalar value, and adding the result to a chain.
21702170
/// The Operands are {ChainOp, VecOp, [Condition]}.
21712171
class VPReductionRecipe : public VPSingleDefRecipe {
2172-
protected:
21732172
/// The recurrence decriptor for the reduction in question.
21742173
const RecurrenceDescriptor &RdxDesc;
21752174
bool IsOrdered;
21762175

2176+
protected:
21772177
VPReductionRecipe(const unsigned char SC, const RecurrenceDescriptor &R,
21782178
Instruction *I, ArrayRef<VPValue *> Operands,
21792179
VPValue *CondOp, bool IsOrdered)

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,6 +1755,7 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
17551755
auto &Builder = State.Builder;
17561756
// Propagate the fast-math flags carried by the underlying instruction.
17571757
IRBuilderBase::FastMathFlagGuard FMFGuard(Builder);
1758+
const RecurrenceDescriptor &RdxDesc = getRecurrenceDescriptor();
17581759
Builder.setFastMathFlags(RdxDesc.getFastMathFlags());
17591760

17601761
RecurKind Kind = RdxDesc.getRecurrenceKind();
@@ -1773,7 +1774,7 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
17731774
VBuilder.setMask(Mask);
17741775

17751776
Value *NewRed;
1776-
if (IsOrdered) {
1777+
if (isOrdered()) {
17771778
NewRed = createOrderedReduction(VBuilder, RdxDesc, VecOp, Prev);
17781779
} else {
17791780
NewRed = createSimpleTargetReduction(VBuilder, VecOp, RdxDesc);
@@ -1810,6 +1811,7 @@ void VPReductionRecipe::print(raw_ostream &O, const Twine &Indent,
18101811

18111812
void VPReductionEVLRecipe::print(raw_ostream &O, const Twine &Indent,
18121813
VPSlotTracker &SlotTracker) const {
1814+
const RecurrenceDescriptor &RdxDesc = getRecurrenceDescriptor();
18131815
O << Indent << "REDUCE ";
18141816
printAsOperand(O, SlotTracker);
18151817
O << " = ";

0 commit comments

Comments
 (0)