Avoid a bug in the path count computation, preventing an infinite

loop repeatedlt making the same change. This is for rdar://11256239.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155160 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2012-04-19 21:50:46 +00:00
parent c8969fd291
commit 8b74e5afda
2 changed files with 49 additions and 1 deletions

View File

@ -3379,7 +3379,7 @@ ObjCARCOpt::PerformCodePlacement(DenseMap<const BasicBlock *, BBState>
// Ok, everything checks out and we're all set. Let's move some code!
Changed = true;
AnyPairsCompletelyEliminated = NewCount == 0;
AnyPairsCompletelyEliminated = OldCount != 0 && NewCount == 0;
NumRRs += OldCount - NewCount;
MoveCalls(Arg, RetainsToMove, ReleasesToMove,
Retains, Releases, DeadInsts, M);