File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
unittests/Transforms/Vectorize Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -173,10 +173,7 @@ class VPBlockUtils {
173173 Succ->replacePredecessor (Old, New);
174174
175175 // Replace any references to Old in widened phi incoming blocks.
176- while (auto *Region = dyn_cast<VPRegionBlock>(Succ))
177- Succ = Region->getEntry ();
178-
179- for (auto &R : *cast<VPBasicBlock>(Succ))
176+ for (auto &R : Succ->getEntryBasicBlock ()->phis ())
180177 if (auto *WidenPhiR = dyn_cast<VPWidenPHIRecipe>(&R))
181178 for (unsigned I = 0 ; I < WidenPhiR->getNumOperands (); I++)
182179 if (WidenPhiR->getIncomingBlock (I) == Old)
Original file line number Diff line number Diff line change @@ -661,6 +661,8 @@ TEST_F(VPBasicBlockTest, TraversingIteratorTest) {
661661
662662TEST_F (VPBasicBlockTest, reassociateBlocks) {
663663 {
664+ // Ensure that when we reassociate a basic block, we make sure to update any
665+ // references to it in VPWidenPHIRecipes' incoming blocks.
664666 VPlan &Plan = getPlan ();
665667 VPBasicBlock *VPBB1 = Plan.createVPBasicBlock (" VPBB1" );
666668 VPBasicBlock *VPBB2 = Plan.createVPBasicBlock (" VPBB2" );
@@ -679,6 +681,8 @@ TEST_F(VPBasicBlockTest, reassociateBlocks) {
679681 }
680682
681683 {
684+ // Ensure that we update VPWidenPHIRecipes that are nested inside a
685+ // VPRegionBlock.
682686 VPlan &Plan = getPlan ();
683687 VPBasicBlock *VPBB1 = Plan.createVPBasicBlock (" VPBB1" );
684688 VPBasicBlock *VPBB2 = Plan.createVPBasicBlock (" VPBB2" );
You can’t perform that action at this time.
0 commit comments