Go to the documentation of this file.
16 #ifndef LLVM_LIB_TRANSFORMS_OBJCARC_PTRSTATE_H
17 #define LLVM_LIB_TRANSFORMS_OBJCARC_PTRSTATE_H
34 class BundledRetainClaimRVs;
35 class ProvenanceAnalysis;
213 #endif // LLVM_LIB_TRANSFORMS_OBJCARC_PTRSTATE_H
raw_ostream & operator<<(raw_ostream &OS, const ARCInstKind Class)
This is an optimization pass for GlobalISel generic memory operations.
const MDNode * GetReleaseMetadata() const
const RRInfo & GetRRInfo() const
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...
unsigned char Seq
The current position in the sequence.
bool HasReverseInsertPts() const
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
bool MatchWithRelease(ARCMDKindCache &Cache, Instruction *Release)
Return true if this set of retains can be paired with the given release.
This is similar to BasicAliasAnalysis, and it uses many of the same techniques, except it uses specia...
#define LLVM_ATTRIBUTE_UNUSED
void SetTailCallRelease(const bool NewValue)
void InsertCall(Instruction *I)
LLVM Basic Block Representation.
void SetKnownPositiveRefCount()
Unidirectional information about either a retain-decrement-use-release sequence or release-use-decrem...
TopDownPtrState()=default
bool IsCFGHazardAfflicted() const
void ResetSequenceProgress(Sequence NewSeq)
bool KnownSafe
After an objc_retain, the reference count of the referenced object is known to be positive.
void InsertReverseInsertPt(Instruction *I)
This class implements an extremely fast bulk output stream that can only output to a stream.
void ClearSequenceProgress()
@ S_Retain
objc_retain(x).
SmallPtrSet< Instruction *, 2 > ReverseInsertPts
The set of optimal insert positions for moving calls in the opposite sequence.
BottomUpPtrState()=default
bool IsTailCallRelease() const
void HandlePotentialUse(Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA, ARCInstKind Class)
bool IsTrackingImpreciseReleases() const
@ S_Stop
code motion is stopped.
bool HandlePotentialAlterRefCount(Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA, ARCInstKind Class)
void SetCFGHazardAfflicted(const bool NewValue)
void Merge(const PtrState &Other, bool TopDown)
bool IsTailCallRelease
True of the objc_release calls are all marked with the "tail" keyword.
void HandlePotentialUse(BasicBlock *BB, Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA, ARCInstKind Class)
@ S_MovableRelease
objc_release(x), !clang.imprecise_release.
void SetSeq(Sequence NewSeq)
@ BasicBlock
Various leaf nodes.
bool CFGHazardAfflicted
If this is true, we cannot perform code motion but can still remove retain/release pairs.
A cache of MDKinds used by various ARC optimizations.
MDNode * ReleaseMetadata
If the Calls are objc_release calls and they all have a clang.imprecise_release tag,...
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
SmallPtrSet< Instruction *, 2 > Calls
For a top-down sequence, the set of objc_retains or objc_retainBlocks.
bool KnownPositiveRefCount
True if the reference count is known to be incremented.
void ClearReverseInsertPts()
RRInfo RRI
Unidirectional information about the current sequence.
bool MatchWithRetain()
Return true if this set of releases can be paired with a release.
bool InitBottomUp(ARCMDKindCache &Cache, Instruction *I)
(Re-)Initialize this bottom up pointer returning true if we detected a pointer with nested releases.
void ClearKnownPositiveRefCount()
void SetKnownSafe(const bool NewValue)
bool HandlePotentialAlterRefCount(Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA, ARCInstKind Class, const BundledRetainClaimRVs &BundledRVs)
@ S_CanRelease
foo(x) – x could possibly see a ref count decrement.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
This class summarizes several per-pointer runtime properties which are propagated through the flow gr...
LLVM Value Representation.
bool HasKnownPositiveRefCount() const
bool Merge(const RRInfo &Other)
Conservatively merge the two RRInfo.
bool InitTopDown(ARCInstKind Kind, Instruction *I)
(Re-)Initialize this bottom up pointer returning true if we detected a pointer with nested releases.