[llvm] r178921 - Properly model precise lifetime when given an incomplete dataflow sequence.
Bob Wilson
bob.wilson at apple.com
Sat Apr 6 10:19:50 PDT 2013
On Apr 5, 2013, at 3:54 PM, Michael Gottesman <mgottesman at apple.com> wrote:
> Author: mgottesman
> Date: Fri Apr 5 17:54:28 2013
> New Revision: 178921
>
> URL: http://llvm.org/viewvc/llvm-project?rev=178921&view=rev
> Log:
> Properly model precise lifetime when given an incomplete dataflow sequence.
>
> Modified: llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp?rev=178921&r1=178920&r2=178921&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp (original)
> +++ llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp Fri Apr 5 17:54:28 2013
> @@ -408,6 +408,10 @@ namespace {
> KnownSafe(false), IsTailCallRelease(false), ReleaseMetadata(0) {}
>
> void clear();
> +
Please remove the trailing whitespace here.
> + bool IsTrackingImpreciseReleases() {
> + return ReleaseMetadata != 0;
> + }
> };
> }
>
> @@ -1746,7 +1750,9 @@ ObjCARCOpt::VisitInstructionBottomUp(Ins
> bool NestingDetected = false;
> InstructionClass Class = GetInstructionClass(Inst);
> const Value *Arg = 0;
> -
> +
> + DEBUG(dbgs() << "Class: " << Class << "\n");
> +
…and here, and also on most of the other blank lines added to this file in this patch.
> switch (Class) {
> case IC_Release: {
> Arg = GetObjCArg(Inst);
> @@ -1794,7 +1800,10 @@ ObjCARCOpt::VisitInstructionBottomUp(Ins
> case S_Release:
> case S_MovableRelease:
> case S_Use:
> - S.RRI.ReverseInsertPts.clear();
> + // If OldSeq is not S_Use or OldSeq is S_Use and we are tracking an
> + // imprecise release, clear our reverse insertion points.
> + if (OldSeq != S_Use || S.RRI.IsTrackingImpreciseReleases())
> + S.RRI.ReverseInsertPts.clear();
> // FALL THROUGH
> case S_CanRelease:
> // Don't do retain+release tracking for IC_RetainRV, because it's
> @@ -2017,14 +2026,19 @@ ObjCARCOpt::VisitInstructionTopDown(Inst
>
> PtrState &S = MyStates.getPtrTopDownState(Arg);
> S.ClearKnownPositiveRefCount();
> -
> - switch (S.GetSeq()) {
> +
> + Sequence OldSeq = S.GetSeq();
> +
> + MDNode *ReleaseMetadata = Inst->getMetadata(ImpreciseReleaseMDKind);
> +
> + switch (OldSeq) {
> case S_Retain:
> case S_CanRelease:
> - S.RRI.ReverseInsertPts.clear();
> + if (OldSeq == S_Retain || ReleaseMetadata != 0)
> + S.RRI.ReverseInsertPts.clear();
> // FALL THROUGH
> case S_Use:
> - S.RRI.ReleaseMetadata = Inst->getMetadata(ImpreciseReleaseMDKind);
> + S.RRI.ReleaseMetadata = ReleaseMetadata;
> S.RRI.IsTailCallRelease = cast<CallInst>(Inst)->isTailCall();
> Releases[Inst] = S.RRI;
> ANNOTATE_TOPDOWN(Inst, Arg, S.GetSeq(), S_None)
> ;
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130406/5d806d87/attachment.html>
More information about the llvm-commits
mailing list