Go to the documentation of this file.
32 return OS <<
"ARCInstKind::Retain";
34 return OS <<
"ARCInstKind::RetainRV";
36 return OS <<
"ARCInstKind::UnsafeClaimRV";
38 return OS <<
"ARCInstKind::RetainBlock";
40 return OS <<
"ARCInstKind::Release";
42 return OS <<
"ARCInstKind::Autorelease";
44 return OS <<
"ARCInstKind::AutoreleaseRV";
46 return OS <<
"ARCInstKind::AutoreleasepoolPush";
48 return OS <<
"ARCInstKind::AutoreleasepoolPop";
50 return OS <<
"ARCInstKind::NoopCast";
52 return OS <<
"ARCInstKind::FusedRetainAutorelease";
54 return OS <<
"ARCInstKind::FusedRetainAutoreleaseRV";
56 return OS <<
"ARCInstKind::LoadWeakRetained";
58 return OS <<
"ARCInstKind::StoreWeak";
60 return OS <<
"ARCInstKind::InitWeak";
62 return OS <<
"ARCInstKind::LoadWeak";
64 return OS <<
"ARCInstKind::MoveWeak";
66 return OS <<
"ARCInstKind::CopyWeak";
68 return OS <<
"ARCInstKind::DestroyWeak";
70 return OS <<
"ARCInstKind::StoreStrong";
72 return OS <<
"ARCInstKind::CallOrUser";
74 return OS <<
"ARCInstKind::Call";
76 return OS <<
"ARCInstKind::User";
78 return OS <<
"ARCInstKind::IntrinsicUser";
80 return OS <<
"ARCInstKind::None";
91 case Intrinsic::objc_autorelease:
93 case Intrinsic::objc_autoreleasePoolPop:
95 case Intrinsic::objc_autoreleasePoolPush:
97 case Intrinsic::objc_autoreleaseReturnValue:
99 case Intrinsic::objc_copyWeak:
101 case Intrinsic::objc_destroyWeak:
103 case Intrinsic::objc_initWeak:
105 case Intrinsic::objc_loadWeak:
107 case Intrinsic::objc_loadWeakRetained:
109 case Intrinsic::objc_moveWeak:
111 case Intrinsic::objc_release:
113 case Intrinsic::objc_retain:
115 case Intrinsic::objc_retainAutorelease:
117 case Intrinsic::objc_retainAutoreleaseReturnValue:
119 case Intrinsic::objc_retainAutoreleasedReturnValue:
121 case Intrinsic::objc_retainBlock:
123 case Intrinsic::objc_storeStrong:
125 case Intrinsic::objc_storeWeak:
127 case Intrinsic::objc_clang_arc_use:
129 case Intrinsic::objc_unsafeClaimAutoreleasedReturnValue:
131 case Intrinsic::objc_retainedObject:
133 case Intrinsic::objc_unretainedObject:
135 case Intrinsic::objc_unretainedPointer:
137 case Intrinsic::objc_retain_autorelease:
139 case Intrinsic::objc_sync_enter:
141 case Intrinsic::objc_sync_exit:
143 case Intrinsic::objc_clang_arc_noop_use:
144 case Intrinsic::objc_arc_annotation_topdown_bbstart:
145 case Intrinsic::objc_arc_annotation_topdown_bbend:
146 case Intrinsic::objc_arc_annotation_bottomup_bbstart:
147 case Intrinsic::objc_arc_annotation_bottomup_bbend:
161 case Intrinsic::returnaddress:
162 case Intrinsic::addressofreturnaddress:
163 case Intrinsic::frameaddress:
164 case Intrinsic::stacksave:
165 case Intrinsic::stackrestore:
166 case Intrinsic::vastart:
167 case Intrinsic::vacopy:
168 case Intrinsic::vaend:
169 case Intrinsic::objectsize:
171 case Intrinsic::stackprotector:
172 case Intrinsic::eh_return_i32:
173 case Intrinsic::eh_return_i64:
174 case Intrinsic::eh_typeid_for:
175 case Intrinsic::eh_dwarf_cfa:
176 case Intrinsic::eh_sjlj_lsda:
177 case Intrinsic::eh_sjlj_functioncontext:
178 case Intrinsic::init_trampoline:
179 case Intrinsic::adjust_trampoline:
180 case Intrinsic::lifetime_start:
181 case Intrinsic::lifetime_end:
182 case Intrinsic::invariant_start:
183 case Intrinsic::invariant_end:
185 case Intrinsic::dbg_declare:
186 case Intrinsic::dbg_value:
187 case Intrinsic::dbg_label:
204 case Intrinsic::memmove:
205 case Intrinsic::memset:
221 switch (
I->getOpcode()) {
239 case Instruction::Invoke:
242 case Instruction::BitCast:
243 case Instruction::GetElementPtr:
245 case Instruction::PHI:
247 case Instruction::Br:
248 case Instruction::Switch:
249 case Instruction::IndirectBr:
250 case Instruction::Alloca:
251 case Instruction::VAArg:
253 case Instruction::FAdd:
254 case Instruction::Sub:
255 case Instruction::FSub:
257 case Instruction::FMul:
258 case Instruction::SDiv:
259 case Instruction::UDiv:
260 case Instruction::FDiv:
261 case Instruction::SRem:
262 case Instruction::URem:
263 case Instruction::FRem:
264 case Instruction::Shl:
265 case Instruction::LShr:
266 case Instruction::AShr:
267 case Instruction::And:
268 case Instruction::Or:
269 case Instruction::Xor:
270 case Instruction::SExt:
271 case Instruction::ZExt:
272 case Instruction::Trunc:
273 case Instruction::IntToPtr:
274 case Instruction::FCmp:
275 case Instruction::FPTrunc:
276 case Instruction::FPExt:
277 case Instruction::FPToUI:
278 case Instruction::FPToSI:
279 case Instruction::UIToFP:
280 case Instruction::SIToFP:
281 case Instruction::InsertElement:
282 case Instruction::ExtractElement:
283 case Instruction::ShuffleVector:
284 case Instruction::ExtractValue:
286 case Instruction::ICmp:
299 for (
const Use &U :
I->operands())
@ User
could "use" a pointer
raw_ostream & operator<<(raw_ostream &OS, const ARCInstKind Class)
This is an optimization pass for GlobalISel generic memory operations.
@ RetainBlock
objc_retainBlock
ARCInstKind GetFunctionClass(const Function *F)
Determine if F is one of the special known Functions.
bool IsNeverTail(ARCInstKind Class)
Test if the given class represents instructions which are never safe to mark with the "tail" keyword.
@ LoadWeak
objc_loadWeak (derived)
@ Call
could call objc_release
static bool isInertIntrinsic(unsigned ID)
@ MoveWeak
objc_moveWeak (derived)
ARCInstKind GetARCInstKind(const Value *V)
Map V to its ARCInstKind equivalence class.
bool IsAutorelease(ARCInstKind Class)
Test if the given class is objc_autorelease or equivalent.
@ Autorelease
objc_autorelease
bool CanInterruptRV(ARCInstKind Class)
Test whether the given instruction can autorelease any pointer or cause an autoreleasepool pop.
bool IsPotentialRetainableObjPtr(const Value *Op)
Test whether the given value is possible a retainable object pointer.
@ InitWeak
objc_initWeak (derived)
static bool isUseOnlyIntrinsic(unsigned ID)
@ CallOrUser
could call objc_release and/or "use" pointers
bool IsNoopOnGlobal(ARCInstKind Class)
Test if the given class represents instructions which do nothing if passed a global variable.
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
@ RetainRV
objc_retainAutoreleasedReturnValue
@ NoopCast
objc_retainedObject, etc.
@ CopyWeak
objc_copyWeak (derived)
This class implements an extremely fast bulk output stream that can only output to a stream.
@ IntrinsicUser
llvm.objc.clang.arc.use
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
bool IsAlwaysTail(ARCInstKind Class)
Test if the given class represents instructions which are always safe to mark with the "tail" keyword...
@ AutoreleasepoolPop
objc_autoreleasePoolPop
bool IsNoThrow(ARCInstKind Class)
Test if the given class represents instructions which are always safe to mark with the nounwind attri...
@ FusedRetainAutorelease
objc_retainAutorelease
<%struct.s * > cast struct s *S to sbyte *< sbyte * > sbyte uint cast struct s *agg result to sbyte *< sbyte * > sbyte uint cast struct s *memtmp to sbyte *< sbyte * > sbyte uint ret void llc ends up issuing two memcpy or custom lower memcpy(of small size) to be ldmia/stmia. I think option 2 is better but the current register allocator cannot allocate a chunk of registers at a time. A feasible temporary solution is to use specific physical registers at the lowering time for small(<
bool IsRetain(ARCInstKind Class)
Test if the given class is objc_retain or equivalent.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ AutoreleasepoolPush
objc_autoreleasePoolPush
@ StoreWeak
objc_storeWeak (primitive)
@ FusedRetainAutoreleaseRV
objc_retainAutoreleaseReturnValue
@ DestroyWeak
objc_destroyWeak (derived)
ARCInstKind GetCallSiteClass(const CallBase &CB)
Helper for GetARCInstKind.
@ StoreStrong
objc_storeStrong (derived)
bool CanDecrementRefCount(ARCInstKind Kind)
Returns false if conservatively we can prove that any instruction mapped to this kind can not decreme...
@ None
anything that is inert from an ARC perspective.
This class represents a function call, abstracting a target machine's calling convention.
LLVM Value Representation.
bool IsForwarding(ARCInstKind Class)
Test if the given class represents instructions which return their argument verbatim.
bool IsNoopOnNull(ARCInstKind Class)
Test if the given class represents instructions which do nothing if passed a null pointer.
@ LoadWeakRetained
objc_loadWeakRetained (primitive)
A Use represents the edge between a Value definition and its users.
bool IsUser(ARCInstKind Class)
Test if the given class is a kind of user.
@ UnsafeClaimRV
objc_unsafeClaimAutoreleasedReturnValue
@ AutoreleaseRV
objc_autoreleaseReturnValue