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 {
301
301
// / Returns the reduction variables found in the loop.
302
302
const ReductionList &getReductionVars () const { return Reductions; }
303
303
304
+ RecurrenceDescriptor getRecurrenceDescriptor (PHINode *PN) const {
305
+ assert (Reductions.contains (PN) && " no recurrence descriptor for phi" );
306
+ return Reductions.lookup (PN);
307
+ }
308
+
304
309
// / Returns the induction variables found in the loop.
305
310
const InductionList &getInductionVars () const { return Inductions; }
306
311
Original file line number Diff line number Diff line change @@ -9173,7 +9173,7 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
9173
9173
if (CM.blockNeedsPredicationForAnyReason (CurrentLinkI->getParent ()))
9174
9174
CondOp = RecipeBuilder.getBlockInMask (CurrentLink->getParent ());
9175
9175
9176
- const RecurrenceDescriptor & RdxDesc = Legal->getReductionVars (). lookup (
9176
+ RecurrenceDescriptor RdxDesc = Legal->getRecurrenceDescriptor (
9177
9177
cast<PHINode>(PhiR->getUnderlyingInstr ()));
9178
9178
// Non-FP RdxDescs will have all fast math flags set, so clear them.
9179
9179
FastMathFlags FMFs = isa<FPMathOperator>(CurrentLinkI)
Original file line number Diff line number Diff line change @@ -740,8 +740,8 @@ Value *VPInstruction::generate(VPTransformState &State) {
740
740
Value *ReducedPartRdx = State.get (getOperand (2 ));
741
741
for (unsigned Idx = 3 ; Idx < getNumOperands (); ++Idx)
742
742
ReducedPartRdx = Builder.CreateBinOp (
743
- ( Instruction::BinaryOps) RecurrenceDescriptor::getOpcode (
744
- RecurKind::AnyOf),
743
+ static_cast < Instruction::BinaryOps> (
744
+ RecurrenceDescriptor::getOpcode ( RecurKind::AnyOf) ),
745
745
State.get (getOperand (Idx)), ReducedPartRdx, " bin.rdx" );
746
746
return createAnyOfReduction (Builder, ReducedPartRdx,
747
747
State.get (getOperand (1 ), VPLane (0 )), OrigPhi);
You can’t perform that action at this time.
0 commit comments