Go to the documentation of this file.
39 #define DEBUG_TYPE "objc-arc-ap-elim"
47 if (!
Callee->hasExactDefinition())
51 if (
const CallBase *JCB = dyn_cast<CallBase>(&
I))
54 if (Depth < 3 && !JCB->onlyReadsMemory() &&
55 MayAutorelease(*JCB,
Depth + 1))
76 if (Push && cast<CallInst>(&Inst)->getArgOperand(0) == Push) {
78 LLVM_DEBUG(
dbgs() <<
"ObjCARCAPElim::OptimizeBB: Zapping push pop "
84 Inst.eraseFromParent();
90 if (MayAutorelease(cast<CallBase>(Inst)))
119 "llvm.global_ctors is uncooperative!");
121 bool Changed =
false;
130 Function *
F = dyn_cast<Function>(cast<ConstantStruct>(
Op)->getOperand(1));
136 if (
F->isDeclaration())
139 if (std::next(
F->begin()) !=
F->end())
142 Changed |= OptimizeBB(&
F->front());
ARCInstKind GetBasicARCInstKind(const Value *V)
Determine which objc runtime call instruction class V belongs to.
A set of analyses that are preserved following a run of a transformation pass.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
LLVM Basic Block Representation.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
@ CallOrUser
could call objc_release and/or "use" pointers
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
ConstantArray - Constant Array Declarations.
@ AutoreleasepoolPop
objc_autoreleasePoolPop
const Constant * getInitializer() const
getInitializer - Return the initializer for this global variable.
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
bool hasDefinitiveInitializer() const
hasDefinitiveInitializer - Whether the global variable has an initializer, and any other instances of...
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool EnableARCOpts
A handy option to enable/disable all ARC Optimizations.
A Module instance is used to store all the information related to an LLVM module.
Represents analyses that only rely on functions' control flow.
amdgpu Simplify well known AMD library false FunctionCallee Callee
@ AutoreleasepoolPush
objc_autoreleasePoolPush
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
bool ModuleHasARC(const Module &M)
Test if the given module looks interesting to run ARC optimization on.
static bool runImpl(Function &F, const TargetLowering &TLI)
void preserveSet()
Mark an analysis set as preserved.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
A container for analyses that lazily runs them and caches their results.
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
LLVM Value Representation.
A Use represents the edge between a Value definition and its users.