File tree Expand file tree Collapse file tree 3 files changed +14
-14
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 3 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -950,7 +950,7 @@ class VPIRMetadata {
950950 }
951951
952952 // / Intersect this VPIRMetada object with \p MD, keeping only metadata
953- // / nodes in both.
953+ // / nodes that are common to both.
954954 void intersect (const VPIRMetadata &MD);
955955};
956956
Original file line number Diff line number Diff line change @@ -1561,14 +1561,16 @@ void VPIRMetadata::applyMetadata(Instruction &I) const {
15611561}
15621562
15631563void VPIRMetadata::intersect (const VPIRMetadata &Other) {
1564- SmallVector<std::pair<unsigned , MDNode *>> MetadataUnion ;
1564+ SmallVector<std::pair<unsigned , MDNode *>> MetadataIntersection ;
15651565 for (const auto &[KindA, MDA] : Metadata) {
15661566 for (const auto &[KindB, MDB] : Other.Metadata ) {
1567- if (KindA == KindB && MDA == MDB)
1568- MetadataUnion.emplace_back (KindA, MDA);
1567+ if (KindA == KindB && MDA == MDB) {
1568+ MetadataIntersection.emplace_back (KindA, MDA);
1569+ break ;
1570+ }
15691571 }
15701572 }
1571- Metadata = std::move (MetadataUnion );
1573+ Metadata = std::move (MetadataIntersection );
15721574}
15731575
15741576void VPWidenCallRecipe::execute (VPTransformState &State) {
Original file line number Diff line number Diff line change @@ -2614,21 +2614,19 @@ void VPlanTransforms::createInterleaveGroups(
26142614 for (const auto *IG : InterleaveGroups) {
26152615 auto *Start =
26162616 cast<VPWidenMemoryRecipe>(RecipeBuilder.getRecipe (IG->getMember (0 )));
2617-
26182617 VPIRMetadata InterleaveMD (*Start);
26192618 SmallVector<VPValue *, 4 > StoredValues;
26202619 if (auto *StoreR = dyn_cast<VPWidenStoreRecipe>(Start))
26212620 StoredValues.push_back (StoreR->getStoredValue ());
26222621 for (unsigned I = 1 ; I < IG->getFactor (); ++I) {
2623- Instruction *MemI = IG->getMember (I);
2624- if (!MemI )
2622+ Instruction *MemberI = IG->getMember (I);
2623+ if (!MemberI )
26252624 continue ;
2626- VPWidenMemoryRecipe *MemR =
2627- cast<VPWidenMemoryRecipe>(RecipeBuilder.getRecipe (MemI));
2628- if (!StoredValues.empty ())
2629- StoredValues.push_back (
2630- cast<VPWidenStoreRecipe>(MemR)->getStoredValue ());
2631- InterleaveMD.intersect (*MemR);
2625+ VPWidenMemoryRecipe *MemoryR =
2626+ cast<VPWidenMemoryRecipe>(RecipeBuilder.getRecipe (MemberI));
2627+ if (auto *StoreR = dyn_cast<VPWidenStoreRecipe>(MemoryR))
2628+ StoredValues.push_back (StoreR->getStoredValue ());
2629+ InterleaveMD.intersect (*MemoryR);
26322630 }
26332631
26342632 bool NeedsMaskForGaps =
You can’t perform that action at this time.
0 commit comments