summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* CVP: If we have a PHI with an incoming select, try to skip the select.Benjamin Kramer2013-02-241-5/+24
| | | | | | | | | | This is a common pattern with dyn_cast and similar constructs, when the PHI no longer depends on the select it can often be turned into a simpler construct or even get hoisted out of the loop. PR15340. llvm-svn: 175995
* Implement the NoBuiltin attribute.Bill Wendling2013-02-221-1/+1
| | | | | | | | The 'nobuiltin' attribute is applied to call sites to indicate that LLVM should not treat the callee function as a built-in function. I.e., it shouldn't try to replace that function with different code. llvm-svn: 175835
* Remove dead code and whitespace.Chad Rosier2013-02-211-10/+0
| | | | llvm-svn: 175804
* Update a comment that looks to have been accidentally deleted many moons ago.Chad Rosier2013-02-201-1/+1
| | | | llvm-svn: 175658
* Remove unused variable.Jakub Staszak2013-02-191-2/+1
| | | | llvm-svn: 175568
* Minor cleanups. No functionality change.Jakub Staszak2013-02-191-10/+7
| | | | llvm-svn: 175567
* Remove unneeded #includes.Jakub Staszak2013-02-191-2/+0
| | | | llvm-svn: 175565
* Fix typos.Jakub Staszak2013-02-191-10/+10
| | | | llvm-svn: 175562
* Reduce indents in LSRInstance::NarrowSearchSpaceByCollapsingUnrolledCode method.Jakub Staszak2013-02-161-67/+67
| | | | | | No functionality change. llvm-svn: 175364
* Actually delete this code, since it's really not clear what it'sDan Gohman2013-02-121-24/+0
| | | | | | trying to do. llvm-svn: 175014
* Record PRE predecessors with a SmallVector instead of a DenseMap, andDan Gohman2013-02-121-8/+9
| | | | | | avoid a second pred_iterator traversal. llvm-svn: 175001
* When disabling PRE for a value is directly redundant with itselfDan Gohman2013-02-121-0/+2
| | | | | | | (through a loop), don't continue to iterate through the reamining predecessors. llvm-svn: 174994
* Check that pointers are removed from maps before calling delete on the pointers,Dan Gohman2013-02-121-3/+3
| | | | | | for tidiness' sake. llvm-svn: 174988
* Minor code simplification.Dan Gohman2013-02-121-1/+1
| | | | llvm-svn: 174985
* LSR IVChain improvement.Andrew Trick2013-02-091-1/+13
| | | | | | | | | Handle chains in which the same offset is used for both loads and stores to the same array. Fixes rdar://11410078. llvm-svn: 174789
* Remove #includes from the commonly used LoopInfo.h.Jakub Staszak2013-02-092-0/+2
| | | | llvm-svn: 174786
* This patch aims to improve compile time performance by increasingPreston Gurd2013-02-011-13/+13
| | | | | | | | | | | | | the SCEV vector size in LoopStrengthReduce. It is observed that the BaseRegs vector size is 4 in most cases, and elements are frequently copied when it is initialized as SmallVector<const SCEV *, 2> BaseRegs. Our benchmark results show that the compilation time performance improved by ~0.5%. Patch by Wan Xiaofei. llvm-svn: 174219
* Change GetPointerBaseWithConstantOffset's DataLayout argument from aDan Gohman2013-01-312-6/+6
| | | | | | | reference to a pointer, so that it can handle the case where DataLayout is not available and behave conservatively. llvm-svn: 174024
* Fixing warnings revealed by gcc release buildEdwin Vane2013-01-291-0/+1
| | | | | | | Fixed set-but-not-used warnings. Reviewer: gribozavr llvm-svn: 173810
* Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation ↵Michael Gottesman2013-01-283-4574/+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
* Begin fleshing out an interface in TTI for modelling the costs ofChandler Carruth2013-01-221-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | generic function calls and intrinsics. This is somewhat overlapping with an existing intrinsic cost method, but that one seems targetted at vector intrinsics. I'll merge them or separate their names and use cases in a separate commit. This sinks the test of 'callIsSmall' down into TTI where targets can control it. The whole thing feels very hack-ish to me though. I've left a FIXME comment about the fundamental design problem this presents. It isn't yet clear to me what the users of this function *really* care about. I'll have to do more analysis to figure that out. Putting this here at least provides it access to proper analysis pass tools and other such. It also allows us to more cleanly implement the baseline cost interfaces in TTI. With this commit, it is now theoretically possible to simplify much of the inline cost analysis's handling of calls by calling through to this interface. That conversion will have to happen in subsequent commits as it requires more extensive restructuring of the inline cost analysis. The CodeMetrics class is now really only in the business of running over a block of code and aggregating the metrics on that block of code, with the actual cost evaluation done entirely in terms of TTI. llvm-svn: 173148
* Switch CodeMetrics itself over to use TTI to determine if an instructionChandler Carruth2013-01-213-9/+21
| | | | | | | | | | | | is free. The whole CodeMetrics API should probably be reworked more, but this is enough to allow deleting the duplicate code there for computing whether an instruction is free. All of the passes using this have been updated to pull in TTI and hand it to the CodeMetrics stuff. Further, a dead CodeMetrics API (analyzeFunction) is nuked for lack of users. llvm-svn: 173036
* Improved comment.Michael Gottesman2013-01-181-2/+5
| | | | llvm-svn: 172864
* Fixed typo in comment.Michael Gottesman2013-01-181-2/+2
| | | | llvm-svn: 172863
* Use AttributeSet accessor methods instead of Attribute accessor methods.Bill Wendling2013-01-181-6/+6
| | | | | | | Further encapsulation of the Attribute object. Don't allow direct access to the Attribute object as an aggregate. llvm-svn: 172853
* 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
* Fix an editor goof in r171738 that Bill spotted. He may even have a testChandler Carruth2013-01-121-1/+1
| | | | | | | | case, but looking at the diff this was an obviously unintended change. Thanks for the careful review Bill! =] llvm-svn: 172336
* 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
* PR14904: Segmentation fault running pass 'Recognize loop idioms'Shuxin Yang2013-01-101-1/+1
| | | | | | | | The root cause is mistakenly taking for granted that "dyn_cast<Instruction>(a-Value)" return a non-NULL instruction. llvm-svn: 172145
* [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
* LICM: Hoist insertvalue/extractvalue out of loops.Benjamin Kramer2013-01-091-7/+6
| | | | | | Fixes PR14854. llvm-svn: 171984
OpenPOWER on IntegriCloud