summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/ObjCARC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a new ObjC ARC optimization pass to eliminate unneededDan Gohman2012-01-171-1/+117
| | | | | | autorelease push+pop pairs. llvm-svn: 148330
* Remove unreachable code. (replace with llvm_unreachable to help GCC where ↵David Blaikie2012-01-171-1/+0
| | | | | | necessary) llvm-svn: 148284
* Fix an unused variable warning that Chad noticed.Dan Gohman2012-01-141-1/+1
| | | | llvm-svn: 148164
* Implement proper ObjC ARC objc_retainBlock "escape" analysis, so thatDan Gohman2012-01-131-45/+63
| | | | | | | | the optimizer doesn't eliminate objc_retainBlock calls which are needed for their side effect of copying blocks onto the heap. This implements rdar://10361249. llvm-svn: 148076
* Fix a copy+pasto. No testcase, because the symptoms of dereferencingDan Gohman2011-12-211-1/+1
| | | | | | an invalid iterator aren't reproducible. rdar://10614085. llvm-svn: 147098
* It turns out that clang does use pointer-to-function types toDan Gohman2011-12-141-2/+6
| | | | | | point to ARC-managed pointers sometimes. This fixes rdar://10551239. llvm-svn: 146577
* When computing reverse-CFG reverse-post-order, skip backedges, asDan Gohman2011-12-121-38/+94
| | | | | | | | | | | | | detected in the forward-CFG DFS. This prevents the reverse-CFG from visiting blocks inside loops after blocks that dominate them in the case where loops have multiple exits. No testcase, because this fixes a bug which in practice only shows up in a full optimizer run, due to the use-list order. This fixes rdar://10422791 and others. llvm-svn: 146408
* Add a TODO comment.Dan Gohman2011-12-121-0/+1
| | | | llvm-svn: 146389
* Fix a copy+pasto in a comment.Dan Gohman2011-12-121-1/+1
| | | | llvm-svn: 146385
* Use getArgOperand instead of getOperand on a call.Dan Gohman2011-12-121-1/+1
| | | | llvm-svn: 146384
* Inline SetSeqToRelease into its only caller, since it's more clear that way.Dan Gohman2011-12-121-11/+4
| | | | llvm-svn: 146383
* Fix omitted break statements in a switch.Dan Gohman2011-12-121-0/+2
| | | | llvm-svn: 146380
* Teach the ARC optimizer about the !clang.arc.copy_on_escape metadataDan Gohman2011-10-171-12/+40
| | | | | | | tag on objc_retainBlock calls, which indicates that they may be optimized away. rdar://10211286. llvm-svn: 142298
* Suppress partial retain+release elimination when there's aDan Gohman2011-10-171-2/+24
| | | | | | | possibility that it will span multiple CFG diamonds/triangles which could have different controlling predicates. rdar://10282956 llvm-svn: 142222
* When eliminating unnecessary retain+autorelease on return values,Dan Gohman2011-09-291-1/+2
| | | | | | | handle the case where the retain is in a different basic block. rdar://10210274. llvm-svn: 140815
* Don't eliminate objc_retainBlock calls on stack objects if theDan Gohman2011-09-291-8/+29
| | | | | | | objc_retainBlock call is potentially responsible for copying the block to the heap to extend its lifetime. rdar://10209613. llvm-svn: 140814
* Don't mark objc_retainBlock as nounwind. It calls user copy constructorsDan Gohman2011-09-141-2/+4
| | | | | | which could theoretically throw. llvm-svn: 139710
* objc_retainBlock is not NoModRef because it can update forwarding pointersDan Gohman2011-09-141-1/+2
| | | | | | in memory relevant to the optimizer. rdar://10050579. llvm-svn: 139708
* Change a bunch of isVolatile() checks to check for atomic load/store as well.Eli Friedman2011-09-121-2/+2
| | | | | | | | No tests; these changes aren't really interesting in the sense that the logic is the same for volatile and atomic. I believe this completes all of the changes necessary for the optimizer to handle loads and stores correctly. I'm going to try and come up with some additional testing, though. llvm-svn: 139533
* When inserting new instructions, use getFirstInsertionPt instead ofBill Wendling2011-08-251-2/+2
| | | | | | getFirstNonPHI so that it will skip over the landingpad instructions as well. llvm-svn: 138537
* Add a comment.Dan Gohman2011-08-221-0/+4
| | | | llvm-svn: 138243
* Constant pointers to objects don't need reference counting.Dan Gohman2011-08-221-0/+13
| | | | llvm-svn: 138242
* Track a retain+release nesting level independently of theDan Gohman2011-08-191-36/+64
| | | | | | | | known-incremented level, because the two concepts can be used to prove the saftey of a retain+release removal in different ways. llvm-svn: 138016
* Make it clear that this code is iterating in reverse order through the array.Dan Gohman2011-08-181-2/+3
| | | | llvm-svn: 137985
* Don't convert objc_autoreleaseReturnValue to objc_autorelease if the resultDan Gohman2011-08-121-6/+13
| | | | | | is returned through a bitcast. llvm-svn: 137402
* Don't let arbitrary calls disrupt nested retain+release pairs ifDan Gohman2011-08-121-56/+78
| | | | | | | | | the retains and releases all use the same SSA pointer value. Also, don't let CFG hazards disrupt nested retain+release pair optimizations. llvm-svn: 137399
* Use an actual reverse-CFG reverse-postorder for the bottom-up traversal,Dan Gohman2011-08-121-16/+30
| | | | | | | rather than plain postorder, so that CFG constructs like single-exit loops are reliably visited in a sensible order. llvm-svn: 137398
* Fix typos in comments, and delete an unused function.Dan Gohman2011-08-111-6/+2
| | | | llvm-svn: 137352
* Fix an obvious type. Patch by Ivan Krasin.Evan Cheng2011-08-041-1/+1
| | | | llvm-svn: 136900
* Move the last uses of RetainFunc etc. over to using getRetainCallee() etc.Dan Gohman2011-07-221-23/+35
| | | | | | | so that a declaration for objc_retain is created when needed if it doesn't already exist. rdar://9825114. llvm-svn: 135821
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-21/+21
| | | | llvm-svn: 135375
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-1/+1
| | | | llvm-svn: 135265
* Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad2011-07-121-14/+14
| | | | | | StructType::get() and TargetData::getIntPtrType(). llvm-svn: 134982
* Revert r134893 and r134888 (and related patches in other trees). It was causingBill Wendling2011-07-121-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an assert on Darwin llvm-gcc builds. Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\ ne 2067. etc. http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354 --- Reverse-merging r134893 into '.': U include/llvm/Target/TargetData.h U include/llvm/DerivedTypes.h U tools/bugpoint/ExtractFunction.cpp U unittests/Support/TypeBuilderTest.cpp U lib/Target/ARM/ARMGlobalMerge.cpp U lib/Target/TargetData.cpp U lib/VMCore/Constants.cpp U lib/VMCore/Type.cpp U lib/VMCore/Core.cpp U lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Instrumentation/ProfilingUtils.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/CodeGen/SjLjEHPrepare.cpp --- Reverse-merging r134888 into '.': G include/llvm/DerivedTypes.h U include/llvm/Support/TypeBuilder.h U include/llvm/Intrinsics.h U unittests/Analysis/ScalarEvolutionTest.cpp U unittests/ExecutionEngine/JIT/JITTest.cpp U unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp U unittests/VMCore/PassManagerTest.cpp G unittests/Support/TypeBuilderTest.cpp U lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp U lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp U lib/VMCore/IRBuilder.cpp G lib/VMCore/Type.cpp U lib/VMCore/Function.cpp G lib/VMCore/Core.cpp U lib/VMCore/Module.cpp U lib/AsmParser/LLParser.cpp U lib/Transforms/Utils/CloneFunction.cpp G lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Utils/InlineFunction.cpp U lib/Transforms/Instrumentation/GCOVProfiling.cpp U lib/Transforms/Scalar/ObjCARC.cpp U lib/Transforms/Scalar/SimplifyLibCalls.cpp U lib/Transforms/Scalar/MemCpyOptimizer.cpp G lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/Transforms/IPO/ArgumentPromotion.cpp U lib/Transforms/InstCombine/InstCombineCompares.cpp U lib/Transforms/InstCombine/InstCombineAndOrXor.cpp U lib/Transforms/InstCombine/InstCombineCalls.cpp U lib/CodeGen/DwarfEHPrepare.cpp U lib/CodeGen/IntrinsicLowering.cpp U lib/Bitcode/Reader/BitcodeReader.cpp llvm-svn: 134949
* De-constify Types in FunctionType::get().Jay Foad2011-07-111-14/+14
| | | | llvm-svn: 134888
* Completely short-circuit out ARC optimization if the ARC runtimeDan Gohman2011-06-201-4/+62
| | | | | | functions do not appear in the module. llvm-svn: 133478
* Fix ARCOpt to insert releases on both successors of an invoke ratherDan Gohman2011-06-161-10/+27
| | | | | | than trying to insert them immediately after the invoke. llvm-svn: 133188
* The ARC language-specific optimizer. Credit to Dan Gohman.John McCall2011-06-151-0/+3520
llvm-svn: 133108
OpenPOWER on IntegriCloud