Skip to content

Commit e24ce07

Browse files
committed
Remove some unreachable code. Also add an assertion. NFC
1 parent 8bb6738 commit e24ce07

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/SILOptimizer/ARC/ARCMatchingSet.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,19 +288,18 @@ bool ARCMatchingSetBuilder::matchUpIncDecSetsForPtr() {
288288
bool HaveIncInsertPts = !MatchSet.IncrementInsertPts.empty();
289289
bool HaveDecInsertPts = !MatchSet.DecrementInsertPts.empty();
290290

291+
// We should not have the case which retains have to be anchored topdown and
292+
// releases do not have to be bottomup, or vice-versa.
293+
assert(HaveIncInsertPts == HaveDecInsertPts &&
294+
"Asymmetric insertion points for retains and releases");
295+
291296
// If we have insertion points and partial merges, return false to avoid
292297
// control dependency issues.
293298
if ((HaveIncInsertPts || HaveDecInsertPts) && Partial) {
294299
DEBUG(llvm::dbgs() << "Found partial merge and insert pts. Bailing!\n");
295300
return false;
296301
}
297302

298-
// If we have insertion points for increments, but not for decrements (or
299-
// vis-a-versa), return false. This prevents us from inserting retains and
300-
// removing releases or vis-a-versa.
301-
if (HaveIncInsertPts != HaveDecInsertPts)
302-
return false;
303-
304303
// If we do not have any insertion points but we do have increments, we must
305304
// be eliminating pairs.
306305
if (!HaveIncInsertPts && !MatchSet.Increments.empty())

0 commit comments

Comments
 (0)