File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -1220,11 +1220,6 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
12201220 return Instruction::Add;
12211221 case RecurKind::Mul:
12221222 return Instruction::Mul;
1223- case RecurKind::AnyOf:
1224- case RecurKind::FindFirstIVSMin:
1225- case RecurKind::FindFirstIVUMin:
1226- case RecurKind::FindLastIVSMax:
1227- case RecurKind::FindLastIVUMax:
12281223 case RecurKind::Or:
12291224 return Instruction::Or;
12301225 case RecurKind::And:
@@ -1248,6 +1243,13 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
12481243 case RecurKind::FMaximumNum:
12491244 case RecurKind::FMinimumNum:
12501245 return Instruction::FCmp;
1246+ case RecurKind::AnyOf:
1247+ case RecurKind::FindFirstIVSMin:
1248+ case RecurKind::FindFirstIVUMin:
1249+ case RecurKind::FindLastIVSMax:
1250+ case RecurKind::FindLastIVUMax:
1251+ // TODO: Set AnyOf and FindIV to Instruction::Select once in-loop reductions
1252+ // are supported.
12511253 default :
12521254 llvm_unreachable (" Unknown recurrence operation" );
12531255 }
Original file line number Diff line number Diff line change @@ -6515,9 +6515,14 @@ void LoopVectorizationCostModel::collectInLoopReductions() {
65156515 if (RdxDesc.getRecurrenceType () != Phi->getType ())
65166516 continue ;
65176517
6518+ // In-loop AnyOf and FindIV reductions are not yet supported.
6519+ RecurKind Kind = RdxDesc.getRecurrenceKind ();
6520+ if (RecurrenceDescriptor::isAnyOfRecurrenceKind (Kind) ||
6521+ RecurrenceDescriptor::isFindIVRecurrenceKind (Kind))
6522+ continue ;
6523+
65186524 // If the target would prefer this reduction to happen "in-loop", then we
65196525 // want to record it as such.
6520- RecurKind Kind = RdxDesc.getRecurrenceKind ();
65216526 if (!PreferInLoopReductions && !useOrderedReductions (RdxDesc) &&
65226527 !TTI.preferInLoopReduction (Kind, Phi->getType ()))
65236528 continue ;
Original file line number Diff line number Diff line change @@ -784,10 +784,9 @@ Value *VPInstruction::generate(VPTransformState &State) {
784784 auto *OrigPhi = cast<PHINode>(PhiR->getUnderlyingValue ());
785785 Value *ReducedPartRdx = State.get (getOperand (2 ));
786786 for (unsigned Idx = 3 ; Idx < getNumOperands (); ++Idx)
787- ReducedPartRdx = Builder.CreateBinOp (
788- (Instruction::BinaryOps)RecurrenceDescriptor::getOpcode (
789- RecurKind::AnyOf),
790- State.get (getOperand (Idx)), ReducedPartRdx, " bin.rdx" );
787+ ReducedPartRdx =
788+ Builder.CreateBinOp (Instruction::Or, State.get (getOperand (Idx)),
789+ ReducedPartRdx, " bin.rdx" );
791790 return createAnyOfReduction (Builder, ReducedPartRdx,
792791 State.get (getOperand (1 ), VPLane (0 )), OrigPhi);
793792 }
You can’t perform that action at this time.
0 commit comments