File tree Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -451,12 +451,10 @@ class InductionDescriptor {
451451 : Instruction::BinaryOpsEnd;
452452 }
453453
454- // / Returns a reference to the type cast instructions in the induction
454+ // / Returns an ArrayRef to the type cast instructions in the induction
455455 // / update chain, that are redundant when guarded with a runtime
456456 // / SCEV overflow check.
457- const SmallVectorImpl<Instruction *> &getCastInsts () const {
458- return RedundantCasts;
459- }
457+ ArrayRef<Instruction *> getCastInsts () const { return RedundantCasts; }
460458
461459private:
462460 // / Private constructor - used by \c isInductionPHI.
Original file line number Diff line number Diff line change @@ -684,7 +684,7 @@ void LoopVectorizationLegality::addInductionPhi(
684684 // in the vectorized loop body, record them here. All casts could be recorded
685685 // here for ignoring, but suffices to record only the first (as it is the
686686 // only one that may bw used outside the cast sequence).
687- const SmallVectorImpl <Instruction *> & Casts = ID.getCastInsts ();
687+ ArrayRef <Instruction *> Casts = ID.getCastInsts ();
688688 if (!Casts.empty ())
689689 InductionCastsToIgnore.insert (*Casts.begin ());
690690
Original file line number Diff line number Diff line change @@ -6575,8 +6575,7 @@ void LoopVectorizationCostModel::collectValuesToIgnore() {
65756575 // detection.
65766576 for (const auto &Induction : Legal->getInductionVars ()) {
65776577 const InductionDescriptor &IndDes = Induction.second ;
6578- const SmallVectorImpl<Instruction *> &Casts = IndDes.getCastInsts ();
6579- VecValuesToIgnore.insert_range (Casts);
6578+ VecValuesToIgnore.insert_range (IndDes.getCastInsts ());
65806579 }
65816580}
65826581
Original file line number Diff line number Diff line change @@ -512,7 +512,7 @@ static void removeRedundantInductionCasts(VPlan &Plan) {
512512 // replace it with the original IV. Note that only the final cast is
513513 // expected to have users outside the cast-chain and the dead casts left
514514 // over will be cleaned up later.
515- auto & Casts = IV->getInductionDescriptor ().getCastInsts ();
515+ ArrayRef<Instruction *> Casts = IV->getInductionDescriptor ().getCastInsts ();
516516 VPValue *FindMyCast = IV;
517517 for (Instruction *IRCast : reverse (Casts)) {
518518 VPSingleDefRecipe *FoundUserCast = nullptr ;
You can’t perform that action at this time.
0 commit comments