File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -722,11 +722,17 @@ class InterleavedAccessInfo {
722
722
723
723
// / Release the group and remove all the relationships.
724
724
void releaseGroup (InterleaveGroup<Instruction> *Group) {
725
+ InterleaveGroups.erase (Group);
726
+ releaseGroupWithoutRemovingFromSet (Group);
727
+ }
728
+
729
+ // / Do everything necessary to release the group, apart from removing it from
730
+ // / the InterleaveGroups set.
731
+ void releaseGroupWithoutRemovingFromSet (InterleaveGroup<Instruction> *Group) {
725
732
for (unsigned i = 0 ; i < Group->getFactor (); i++)
726
733
if (Instruction *Member = Group->getMember (i))
727
734
InterleaveGroupMap.erase (Member);
728
735
729
- InterleaveGroups.erase (Group);
730
736
delete Group;
731
737
}
732
738
Original file line number Diff line number Diff line change @@ -1481,20 +1481,19 @@ void InterleavedAccessInfo::invalidateGroupsRequiringScalarEpilogue() {
1481
1481
if (!requiresScalarEpilogue ())
1482
1482
return ;
1483
1483
1484
- bool ReleasedGroup = false ;
1485
1484
// Release groups requiring scalar epilogues. Note that this also removes them
1486
1485
// from InterleaveGroups.
1487
- for ( auto *Group : make_early_inc_range (InterleaveGroups) ) {
1486
+ bool ReleasedGroup = InterleaveGroups. remove_if ([&]( auto *Group) {
1488
1487
if (!Group->requiresScalarEpilogue ())
1489
- continue ;
1488
+ return false ;
1490
1489
LLVM_DEBUG (
1491
1490
dbgs ()
1492
1491
<< " LV: Invalidate candidate interleaved group due to gaps that "
1493
1492
" require a scalar epilogue (not allowed under optsize) and cannot "
1494
1493
" be masked (not enabled). \n " );
1495
- releaseGroup (Group);
1496
- ReleasedGroup = true ;
1497
- }
1494
+ releaseGroupWithoutRemovingFromSet (Group);
1495
+ return true ;
1496
+ });
1498
1497
assert (ReleasedGroup && " At least one group must be invalidated, as a "
1499
1498
" scalar epilogue was required" );
1500
1499
(void )ReleasedGroup;
You can’t perform that action at this time.
0 commit comments