summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/ObjCARC.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation ↵Michael Gottesman2013-01-281-4568/+0
| | | | | | for refactoring the ARC Optimizer. llvm-svn: 173647
* Renamed function IsPotentialUse to IsPotentialRetainableObjPtr.Michael Gottesman2013-01-271-18/+18
| | | | | | | | | This name change does the following: 1. Causes the function name to use proper ARC terminology. 2. Makes it clear what the function truly does. llvm-svn: 173609
* Added comment to ObjCARC elaborating what is meant by the term 'Provenance' ↵Michael Gottesman2013-01-241-0/+6
| | | | | | in 'Provenance Analysis'. llvm-svn: 173374
* Fixed typo.Michael Gottesman2013-01-221-2/+1
| | | | llvm-svn: 173202
* [ObjCARC] Refactored out the inner most 2-loops from PerformCodePlacement ↵Michael Gottesman2013-01-221-153/+198
| | | | | | | | | | | | | | | | into the method ConnectTDBUTraversals. The method PerformCodePlacement was doing too much (i.e. 3x loops, lots of different checking). This refactoring separates the analysis section of the method into a separate function while leaving the actual code placement and analysis preparation in PerformCodePlacement. *NOTE* Really this part of ObjCARC should be refactored out of the main pass class into its own seperate class/struct. But, it is not time to make that change yet though (don't want to make such an invasive change without fixing all of the bugs first). llvm-svn: 173201
* More encapsulation work.Bill Wendling2013-01-221-19/+19
| | | | | | | Use the AttributeSet when we're talking about more than one attribute. Add a function that adds a single attribute. No functionality change intended. llvm-svn: 173196
* Improved comment.Michael Gottesman2013-01-181-2/+5
| | | | llvm-svn: 172864
* Fixed typo in comment.Michael Gottesman2013-01-181-2/+2
| | | | llvm-svn: 172863
* Silence GCC warning about dropping off a non-void function.Benjamin Kramer2013-01-181-0/+1
| | | | llvm-svn: 172839
* Fixed 80+ violation.Michael Gottesman2013-01-181-2/+2
| | | | llvm-svn: 172782
* Added missing const from my last commit.Michael Gottesman2013-01-171-1/+1
| | | | llvm-svn: 172736
* [ObjCARC] Implemented operator<< for InstructionClass and changed a ↵Michael Gottesman2013-01-171-3/+56
| | | | | | ``Visited'' Debug message to use it. llvm-svn: 172735
* [ObjCARC] Turn off ignoring unwind edges in ObjCARC when ↵Michael Gottesman2013-01-161-33/+0
| | | | | | | | | | | | | -fno-objc-arc-exception is enabled due to it's affect on correctness. Specifically according to the semantics of ARC -fno-objc-arc-exception simply states that it is expected that the unwind path out of a call *MAY* not release objects. Thus we can have the situation where a release gets moved into a catch block which we ignore when we remove a retain/release pair resulting in (even though we assume the program is exiting anyways) the cleanup code path potentially blowing up before program exit. llvm-svn: 172599
* Changed SmallPtrSet.count guard + SmallPtrSet.insert to just SmallPtrSet.insert.Michael Gottesman2013-01-141-2/+1
| | | | llvm-svn: 172452
* Fixed some 80+ violations.Michael Gottesman2013-01-141-14/+18
| | | | llvm-svn: 172374
* Updated the documentation in ObjCARC.cpp to fit the style guide better (i.e. ↵Michael Gottesman2013-01-141-232/+259
| | | | | | use doxygen). Still some work to do though. llvm-svn: 172371
* Fixed an infinite loop in the block escape in analysis in ObjCARC caused by ↵Michael Gottesman2013-01-131-3/+14
| | | | | | | | 2x blocks each assigned a value via a phi-node causing each to depend on the other. A test case is provided as well. llvm-svn: 172368
* [ObjCARC] Even more debug messages!Michael Gottesman2013-01-131-1/+17
| | | | llvm-svn: 172347
* [ObjCARC] More debug messages.Michael Gottesman2013-01-131-4/+29
| | | | llvm-svn: 172346
* Fixed debug message in ObjCARC.Michael Gottesman2013-01-121-2/+2
| | | | llvm-svn: 172299
* Fixed a few debug messages in ObjCARC and added one.Michael Gottesman2013-01-121-3/+5
| | | | llvm-svn: 172298
* Fixed bug in ObjCARC where we were changing a call from objc_autoreleaseRV ↵Michael Gottesman2013-01-121-3/+6
| | | | | | => objc_autorelease but were not updating the InstructionClass to IC_Autorelease. llvm-svn: 172288
* Fixed a bug where we were tail calling objc_autorelease causing an object to ↵Michael Gottesman2013-01-121-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | not be placed into an autorelease pool. The reason that this occurs is that tail calling objc_autorelease eventually tail calls -[NSObject autorelease] which supports fast autorelease. This can cause us to violate the semantic gaurantees of __autoreleasing variables that assignment to an __autoreleasing variables always yields an object that is placed into the innermost autorelease pool. The fix included in this patch works by: 1. In the peephole optimization function OptimizeIndividualFunctions, always remove tail call from objc_autorelease. 2. Whenever we convert to/from an objc_autorelease, set/unset the tail call keyword as appropriate. *NOTE* I also handled the case where objc_autorelease is converted in OptimizeReturns to an autoreleaseRV which still violates the ARC semantics. I will be removing that in a later patch and I wanted to make sure that the tree is in a consistent state vis-a-vis ARC always. Additionally some test cases are provided and all tests that have tail call marked objc_autorelease keywords have been modified so that tail call has been removed. *NOTE* One test fails due to a separate bug that I am going to commit soon. Thus I marked the check line TMP: instead of CHECK: so make check does not fail. llvm-svn: 172287
* [ObjCARC Debug Message] Added debug message when we convert an autorelease ↵Michael Gottesman2013-01-101-0/+6
| | | | | | into an autoreleaseRV. llvm-svn: 172034
* [ObjCARC Debug Messages] This is a squashed commit of 3x debug message ↵Michael Gottesman2013-01-091-0/+24
| | | | | | | | | | commits ala echristo's suggestion. 1. Added debug messages when in OptimizeIndividualCalls we move calls into predecessors and then erase the original call. 2. Added debug messages when in the process of moving calls in ObjCARCOpt::MoveCalls we create new RR and delete old RR. 3. Added a debug message when we visit a specific retain instruction in ObjCARCOpt::PerformCodePlacement. llvm-svn: 171988
* Fixed EOL whitespace.Michael Gottesman2013-01-071-29/+29
| | | | llvm-svn: 171791
* [ObjCARC Debug Message] - Added debug message when fuse a retain/autorelease ↵Michael Gottesman2013-01-071-2/+10
| | | | | | pair in ObjCARCContract::ContractAutorelease. llvm-svn: 171679
* [ObjCARC Debug Message] - Added debug message when we zap a matching ↵Michael Gottesman2013-01-071-0/+3
| | | | | | retain/autorelease pair in ObjCARCOpt::OptimizeReturns. llvm-svn: 171678
* [ObjCARC Debug Message] - Added debug message when we erase ARC calls with ↵Michael Gottesman2013-01-071-0/+2
| | | | | | null since they are no-ops. llvm-svn: 171677
* [ObjCARC Debug Message] - Added debug message when we add a nounwind keyword ↵Michael Gottesman2013-01-061-0/+2
| | | | | | to a function which can not throw. llvm-svn: 171676
* [ObjCARC Debug Message] - Added debug message when we add a tail keyword to ↵Michael Gottesman2013-01-061-0/+3
| | | | | | a function which can never be passed stack args. llvm-svn: 171675
* [ObjCARC Debug Messages] - Added missing newline.Michael Gottesman2013-01-061-1/+1
| | | | llvm-svn: 171674
* Added debug statement to ObjCARC when we replace objc_autorelease(x) with ↵Michael Gottesman2013-01-061-0/+8
| | | | | | objc_release(x) when x is otherwise unused. llvm-svn: 171673
* Added 2x Debug statements to ObjCARC that log when we handle the two ↵Michael Gottesman2013-01-061-2/+16
| | | | | | | | undefined pointer-to-weak-pointer is NULL cases by replacing the given call inst with an undefined value. The reason that there are two cases is that the first case handles the unary cases and the second the binary cases. llvm-svn: 171672
* Added debug message in ObjCARC when we remove a no-op cast which has only ↵Michael Gottesman2013-01-061-0/+2
| | | | | | special semantic meaning in the frontend and thus in the optimizer can be deleted. llvm-svn: 171670
* Added debug message to ObjCARC when we transform an ↵Michael Gottesman2013-01-061-0/+12
| | | | | | objc_autoreleaseReturnValue => objc_autorelease due to its operand not being used as a return value. llvm-svn: 171669
* Added debug message to ObjCARC when we transform ↵Michael Gottesman2013-01-051-0/+11
| | | | | | objc_retainAutorelasedReturnValue => objc_retain since the operand to said function is not a return value. llvm-svn: 171629
* Added debug message for ObjCARC when we zap an ↵Michael Gottesman2013-01-051-0/+5
| | | | | | objc_autoreleaseReturnValue/objc_retainAutoreleasedValue pair. llvm-svn: 171628
* Added DEBUG message to ObjCARC when we optimize objc_retain => ↵Michael Gottesman2013-01-041-0/+10
| | | | | | objc_retainAutorelasedReturnValue. llvm-svn: 171535
* Fixed up some DEBUG messages where I was putting in the text of a message ↵Michael Gottesman2013-01-041-8/+8
| | | | | | | | the method where it was being called when I should have just prefixed the actual message with Pass::Method. Additionally I fixed some whitespace issues. llvm-svn: 171534
* Changed two debug statements that state that a queue had finished being ↵Michael Gottesman2013-01-031-2/+2
| | | | | | processed when said queue was really a list to state a list had finished being processed. llvm-svn: 171465
* Added DEBUG message for ObjCARC when we zap a push/pop pair in ↵Michael Gottesman2013-01-031-0/+3
| | | | | | ObjCARCAPElim::OptimizeBB. llvm-svn: 171464
* Added DEBUG message to ObjCARC when we transform objc_initWeak(p, null) => ↵Michael Gottesman2013-01-031-0/+4
| | | | | | *p = null. llvm-svn: 171463
* Added DEBUG message for ObjCARC when an inline asm marker is inserted for ↵Michael Gottesman2013-01-031-0/+2
| | | | | | architectures where this is required to perform a retainAutoreleasedReturnValue optimization. llvm-svn: 171462
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-6/+6
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Resort the #include lines in include/... and lib/... with theChandler Carruth2013-01-021-1/+1
| | | | | | | | | | utils/sort_includes.py script. Most of these are updating the new R600 target and fixing up a few regressions that have creeped in since the last time I sorted the includes. llvm-svn: 171362
* Added DEBUG message when ObjCARC replaces a call which returns its argument ↵Michael Gottesman2013-01-011-2/+6
| | | | | | | | | | | verbatim with its argument to temporarily undo an optimization. Specifically these calls return their argument verbatim, as a low-level optimization. However, this makes high-level optimizations harder. We undo any uses of this optimization that the front-end emitted. We redo them later in the contract pass. llvm-svn: 171346
* Added DEBUG messages to the top of several processing loops in ObjCARC.cpp ↵Michael Gottesman2013-01-011-3/+32
| | | | | | | | | that emit what instructions are being visited. This is a part of a larger effort of adding DEBUG messages to the ARC Optimizer Backend. llvm-svn: 171345
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-25/+25
| | | | | | single attribute in the future. llvm-svn: 170502
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-071-17/+17
| | | | | | in the near future. llvm-svn: 169651
OpenPOWER on IntegriCloud