File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
include/llvm/Transforms/Vectorize Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -301,6 +301,11 @@ class LoopVectorizationLegality {
301301 // / Returns the reduction variables found in the loop.
302302 const ReductionList &getReductionVars () const { return Reductions; }
303303
304+ RecurrenceDescriptor getRecurrenceDescriptor (PHINode *PN) const {
305+ assert (Reductions.contains (PN) && " no recurrence descriptor for phi" );
306+ return Reductions.lookup (PN);
307+ }
308+
304309 // / Returns the induction variables found in the loop.
305310 const InductionList &getInductionVars () const { return Inductions; }
306311
Original file line number Diff line number Diff line change @@ -9173,7 +9173,7 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
91739173 if (CM.blockNeedsPredicationForAnyReason (CurrentLinkI->getParent ()))
91749174 CondOp = RecipeBuilder.getBlockInMask (CurrentLink->getParent ());
91759175
9176- const RecurrenceDescriptor & RdxDesc = Legal->getReductionVars (). lookup (
9176+ RecurrenceDescriptor RdxDesc = Legal->getRecurrenceDescriptor (
91779177 cast<PHINode>(PhiR->getUnderlyingInstr ()));
91789178 // Non-FP RdxDescs will have all fast math flags set, so clear them.
91799179 FastMathFlags FMFs = isa<FPMathOperator>(CurrentLinkI)
Original file line number Diff line number Diff line change @@ -740,8 +740,8 @@ Value *VPInstruction::generate(VPTransformState &State) {
740740 Value *ReducedPartRdx = State.get (getOperand (2 ));
741741 for (unsigned Idx = 3 ; Idx < getNumOperands (); ++Idx)
742742 ReducedPartRdx = Builder.CreateBinOp (
743- ( Instruction::BinaryOps) RecurrenceDescriptor::getOpcode (
744- RecurKind::AnyOf),
743+ static_cast < Instruction::BinaryOps> (
744+ RecurrenceDescriptor::getOpcode ( RecurKind::AnyOf) ),
745745 State.get (getOperand (Idx)), ReducedPartRdx, " bin.rdx" );
746746 return createAnyOfReduction (Builder, ReducedPartRdx,
747747 State.get (getOperand (1 ), VPLane (0 )), OrigPhi);
You can’t perform that action at this time.
0 commit comments