@@ -2482,23 +2482,23 @@ void VPlanTransforms::createInterleaveGroups(
2482
2482
auto *InsertPos =
2483
2483
cast<VPWidenMemoryRecipe>(RecipeBuilder.getRecipe (IRInsertPos));
2484
2484
2485
+ bool InBounds = false ;
2486
+ if (auto *Gep = dyn_cast<GetElementPtrInst>(
2487
+ getLoadStorePointerOperand (IRInsertPos)->stripPointerCasts ()))
2488
+ InBounds = Gep->isInBounds ();
2489
+
2485
2490
// Get or create the start address for the interleave group.
2486
2491
auto *Start =
2487
2492
cast<VPWidenMemoryRecipe>(RecipeBuilder.getRecipe (IG->getMember (0 )));
2488
2493
VPValue *Addr = Start->getAddr ();
2489
2494
VPRecipeBase *AddrDef = Addr->getDefiningRecipe ();
2490
2495
if (AddrDef && !VPDT.properlyDominates (AddrDef, InsertPos)) {
2491
- // TODO: Hoist Addr's defining recipe (and any operands as needed) to
2492
- // InsertPos or sink loads above zero members to join it.
2493
- bool InBounds = false ;
2494
- if (auto *Gep = dyn_cast<GetElementPtrInst>(
2495
- getLoadStorePointerOperand (IRInsertPos)->stripPointerCasts ()))
2496
- InBounds = Gep->isInBounds ();
2497
-
2498
2496
// We cannot re-use the address of member zero because it does not
2499
2497
// dominate the insert position. Instead, use the address of the insert
2500
2498
// position and create a PtrAdd adjusting it to the address of member
2501
2499
// zero.
2500
+ // TODO: Hoist Addr's defining recipe (and any operands as needed) to
2501
+ // InsertPos or sink loads above zero members to join it.
2502
2502
assert (IG->getIndex (IRInsertPos) != 0 &&
2503
2503
" index of insert position shouldn't be zero" );
2504
2504
auto &DL = IRInsertPos->getDataLayout ();
@@ -2522,8 +2522,7 @@ void VPlanTransforms::createInterleaveGroups(
2522
2522
auto *ReversePtr = new VPVectorEndPointerRecipe (
2523
2523
Addr, &Plan.getVF (), getLoadStoreType (IRInsertPos),
2524
2524
-(int64_t )IG->getFactor (),
2525
- GEP && GEP->isInBounds () ? GEPNoWrapFlags::inBounds ()
2526
- : GEPNoWrapFlags::none (),
2525
+ InBounds ? GEPNoWrapFlags::inBounds () : GEPNoWrapFlags::none (),
2527
2526
InsertPos->getDebugLoc ());
2528
2527
ReversePtr->insertBefore (InsertPos);
2529
2528
Addr = ReversePtr;
0 commit comments