17 #ifndef LLVM_LIB_TRANSFORMS_OBJCARC_PTRSTATE_H
18 #define LLVM_LIB_TRANSFORMS_OBJCARC_PTRSTATE_H
31 class ProvenanceAnalysis;
bool Merge(const RRInfo &Other)
Conservatively merge the two RRInfo.
SmallPtrSet< Instruction *, 2 > Calls
For a top-down sequence, the set of objc_retains or objc_retainBlocks.
void ClearReverseInsertPts()
bool HandlePotentialAlterRefCount(Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA, ARCInstKind Class)
bool MatchWithRelease(ARCMDKindCache &Cache, Instruction *Release)
Return true if this set of retains can be paired with the given release.
void SetKnownSafe(const bool NewValue)
bool HasReverseInsertPts() const
SmallPtrSet< Instruction *, 2 > ReverseInsertPts
The set of optimal insert positions for moving calls in the opposite sequence.
unsigned char Seq
The current position in the sequence.
void InsertReverseInsertPt(Instruction *I)
void InsertCall(Instruction *I)
This class summarizes several per-pointer runtime properties which are propagated through the flow gr...
bool IsTailCallRelease
True of the objc_release calls are all marked with the "tail" keyword.
bool InitBottomUp(ARCMDKindCache &Cache, Instruction *I)
(Re-)Initialize this bottom up pointer returning true if we detected a pointer with nested releases...
void ClearKnownPositiveRefCount()
Function Alias Analysis false
void HandlePotentialUse(BasicBlock *BB, Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA, ARCInstKind Class)
const RRInfo & GetRRInfo() const
Unidirectional information about either a retain-decrement-use-release sequence or release-use-decrem...
raw_ostream & operator<<(raw_ostream &OS, const ARCInstKind Class)
const MDNode * GetReleaseMetadata() const
void HandlePotentialUse(Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA, ARCInstKind Class)
RRInfo RRI
Unidirectional information about the current sequence.
LLVM Basic Block Representation.
bool IsCFGHazardAfflicted() const
bool KnownPositiveRefCount
True if the reference count is known to be incremented.
void Merge(const PtrState &Other, bool TopDown)
like S_Release, but code motion is stopped.
#define LLVM_ATTRIBUTE_UNUSED
A cache of MDKinds used by various ARC optimizations.
bool MatchWithRetain()
Return true if this set of releases can be paired with a release.
bool IsTailCallRelease() const
void ResetSequenceProgress(Sequence NewSeq)
bool CFGHazardAfflicted
If this is true, we cannot perform code motion but can still remove retain/release pairs...
objc_release(x), !clang.imprecise_release.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
void SetReleaseMetadata(MDNode *NewValue)
bool Partial
True if we've seen an opportunity for partial RR elimination, such as pushing calls into a CFG triang...
ARCInstKind
Equivalence classes of instructions in the ARC Model.
bool HandlePotentialAlterRefCount(Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA, ARCInstKind Class)
MDNode * ReleaseMetadata
If the Calls are objc_release calls and they all have a clang.imprecise_release tag, this is the metadata tag.
void SetTailCallRelease(const bool NewValue)
void ClearSequenceProgress()
Sequence
A sequence of states that a pointer may go through in which an objc_retain and objc_release are actua...
void SetKnownPositiveRefCount()
void SetSeq(Sequence NewSeq)
bool IsTrackingImpreciseReleases() const
void SetCFGHazardAfflicted(const bool NewValue)
LLVM Value Representation.
foo(x) – x could possibly see a ref count decrement.
bool KnownSafe
After an objc_retain, the reference count of the referenced object is known to be positive...
This class implements an extremely fast bulk output stream that can only output to a stream...
This is similar to BasicAliasAnalysis, and it uses many of the same techniques, except it uses specia...
bool InitTopDown(ARCInstKind Kind, Instruction *I)
(Re-)Initialize this bottom up pointer returning true if we detected a pointer with nested releases...
bool HasKnownPositiveRefCount() const