@@ -2612,12 +2612,8 @@ void VPlanTransforms::createInterleaveGroups(
26122612 VPDominatorTree VPDT;
26132613 VPDT.recalculate (Plan);
26142614 for (const auto *IG : InterleaveGroups) {
2615- // Get or create the start address for the interleave group.
2616- auto *Start =
2617- cast<VPWidenMemoryRecipe>(RecipeBuilder.getRecipe (IG->getMember (0 )));
2618-
2619- VPIRMetadata InterleaveMD (*Start);
26202615 SmallVector<VPValue *, 4 > StoredValues;
2616+ VPIRMetadata InterleaveMD;
26212617 for (unsigned i = 0 ; i < IG->getFactor (); ++i) {
26222618 Instruction *MemI = IG->getMember (i);
26232619 if (!MemI)
@@ -2628,7 +2624,11 @@ void VPlanTransforms::createInterleaveGroups(
26282624 continue ;
26292625 if (auto *StoreR = dyn_cast<VPWidenStoreRecipe>(MemR))
26302626 StoredValues.push_back (StoreR->getStoredValue ());
2631- InterleaveMD.intersect (*MemR);
2627+
2628+ if (i == 0 )
2629+ InterleaveMD = VPIRMetadata (*MemR);
2630+ else
2631+ InterleaveMD.intersect (*MemR);
26322632 }
26332633
26342634 bool NeedsMaskForGaps =
@@ -2644,6 +2644,9 @@ void VPlanTransforms::createInterleaveGroups(
26442644 getLoadStorePointerOperand (IRInsertPos)->stripPointerCasts ()))
26452645 NW = Gep->getNoWrapFlags ().withoutNoUnsignedWrap ();
26462646
2647+ // Get or create the start address for the interleave group.
2648+ auto *Start =
2649+ cast<VPWidenMemoryRecipe>(RecipeBuilder.getRecipe (IG->getMember (0 )));
26472650 VPValue *Addr = Start->getAddr ();
26482651 VPRecipeBase *AddrDef = Addr->getDefiningRecipe ();
26492652 if (AddrDef && !VPDT.properlyDominates (AddrDef, InsertPos)) {
0 commit comments