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 @@ -6591,9 +6591,14 @@ void LoopVectorizationCostModel::collectInLoopReductions() {
65916591 if (RdxDesc.getRecurrenceType () != Phi->getType ())
65926592 continue ;
65936593
6594+ // In-loop AnyOf and FindIV reductions are not yet supported.
6595+ RecurKind Kind = RdxDesc.getRecurrenceKind ();
6596+ if (RecurrenceDescriptor::isAnyOfRecurrenceKind (Kind) ||
6597+ RecurrenceDescriptor::isFindIVRecurrenceKind (Kind))
6598+ continue ;
6599+
65946600 // If the target would prefer this reduction to happen "in-loop", then we
65956601 // want to record it as such.
6596- RecurKind Kind = RdxDesc.getRecurrenceKind ();
65976602 if (!PreferInLoopReductions && !useOrderedReductions (RdxDesc) &&
65986603 !TTI.preferInLoopReduction (Kind, Phi->getType ()))
65996604 continue ;
Original file line number Diff line number Diff line change @@ -821,10 +821,9 @@ Value *VPInstruction::generate(VPTransformState &State) {
821821 auto *OrigPhi = cast<PHINode>(PhiR->getUnderlyingValue ());
822822 Value *ReducedPartRdx = State.get (getOperand (2 ));
823823 for (unsigned Idx = 3 ; Idx < getNumOperands (); ++Idx)
824- ReducedPartRdx = Builder.CreateBinOp (
825- (Instruction::BinaryOps)RecurrenceDescriptor::getOpcode (
826- RecurKind::AnyOf),
827- State.get (getOperand (Idx)), ReducedPartRdx, " bin.rdx" );
824+ ReducedPartRdx =
825+ Builder.CreateBinOp (Instruction::Or, State.get (getOperand (Idx)),
826+ ReducedPartRdx, " bin.rdx" );
828827 return createAnyOfReduction (Builder, ReducedPartRdx,
829828 State.get (getOperand (1 ), VPLane (0 )), OrigPhi);
830829 }
You can’t perform that action at this time.
0 commit comments