summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
Commit message (Collapse)AuthorAgeFilesLines
* Retain the name of the new internal global that's been shrunk.Bill Wendling2013-02-131-2/+5
| | | | | | | | | It's possible (e.g. after an LTO build) that an internal global may be used for debugging purposes. If that's the case appending a '.b' to it makes it hard to find that variable. Steal the name from the old GV before deleting it so that they can find that variable again. llvm-svn: 175104
* Revert accidental commit (ran svn commit from wrong directory).Nick Lewycky2013-02-021-61/+7
| | | | llvm-svn: 174241
* This patch makes "&Cls::purevfn" not an odr use. This isn't what the standardNick Lewycky2013-02-021-7/+61
| | | | | | | | | says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use. Also fixes a bug in the previous patch that caused us to not mark the function referenced just because we didn't want to mark it odr used. llvm-svn: 174240
* Remove addRetAttributes and addFnAttributes, which aren't useful abstractions.Bill Wendling2013-01-301-4/+4
| | | | llvm-svn: 173992
* Convert typeIncompatible to return an AttributeSet.Bill Wendling2013-01-301-3/+10
| | | | | | | There are still places which treat the Attribute object as a collection of attributes. I'm systematically removing them. llvm-svn: 173990
* Unroll again after running BBVectorizeHal Finkel2013-01-291-0/+4
| | | | | | | | Because BBVectorize may significantly shorten a loop body, unroll again after vectorization. This is especially important when using runtime or partial unrolling. llvm-svn: 173730
* Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation ↵Michael Gottesman2013-01-281-1/+1
| | | | | | for refactoring the ARC Optimizer. llvm-svn: 173647
* Use the AttributeSet instead of AttributeWithIndex.Bill Wendling2013-01-271-22/+15
| | | | | | | In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the internals of the AttributeSet to outside users, which isn't goodness. llvm-svn: 173601
* Use the AttributeSet instead of AttributeWithIndex.Bill Wendling2013-01-271-27/+15
| | | | | | | In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the internals of the AttributeSet to outside users, which isn't goodness. llvm-svn: 173600
* Remove some introspection functions.Bill Wendling2013-01-252-10/+13
| | | | | | | | The 'getSlot' function and its ilk allow introspection into the AttributeSet class. However, that class should be opaque. Allow access through accessor methods instead. llvm-svn: 173522
* Use the new 'getSlotIndex' method to retrieve the attribute's slot index.Bill Wendling2013-01-252-3/+3
| | | | llvm-svn: 173499
* added ability to dynamically change the ExportList of an alreadyPedro Artigas2013-01-251-0/+10
| | | | | | created InternalizePass (useful for pass reuse) llvm-svn: 173474
* Add the IR attribute 'sspstrong'.Bill Wendling2013-01-231-10/+35
| | | | | | | | | | | | | | | | | | | | | SSPStrong applies a heuristic to insert stack protectors in these situations: * A Protector is required for functions which contain an array, regardless of type or length. * A Protector is required for functions which contain a structure/union which contains an array, regardless of type or length. Note, there is no limit to the depth of nesting. * A protector is required when the address of a local variable (i.e., stack based variable) is exposed. (E.g., such as through a local whose address is taken as part of the RHS of an assignment or a local whose address is taken as part of a function argument.) This patch implements the SSPString attribute to be equivalent to SSPRequired. This will change in a subsequent patch. llvm-svn: 173230
* Remove the last of uses that use the Attribute object as a collection of ↵Bill Wendling2013-01-233-23/+43
| | | | | | | | | attributes. Collections of attributes are handled via the AttributeSet class now. This finally frees us up to make significant changes to how attributes are structured. llvm-svn: 173228
* Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKindBill Wendling2013-01-232-4/+4
| | | | | | when removing one attribute. This further encapsulates the use of the attributes. llvm-svn: 173214
* Use the AttributeSet when adding multiple attributes and an Attribute::AttrKindBill Wendling2013-01-231-3/+1
| | | | | | when adding a single attribute to the function. llvm-svn: 173210
* More encapsulation work.Bill Wendling2013-01-221-3/+5
| | | | | | | 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
* Have AttributeSet::getRetAttributes() return an AttributeSet instead of ↵Bill Wendling2013-01-212-14/+20
| | | | | | | | | Attribute. This further restricts the use of the Attribute class to the Attribute family of classes. llvm-svn: 173098
* Make AttributeSet::getFnAttributes() return an AttributeSet instead of an ↵Bill Wendling2013-01-212-14/+16
| | | | | | | | | Attribute. This is more code to isolate the use of the Attribute class to that of just holding one attribute instead of a collection of attributes. llvm-svn: 173094
* Make the inline cost a proper analysis pass. This remains essentiallyChandler Carruth2013-01-212-21/+30
| | | | | | | | | | | | | | | | a dynamic analysis done on each call to the routine. However, now it can use the standard pass infrastructure to reference other analyses, instead of a silly setter method. This will become more interesting as I teach it about more analysis passes. This updates the two inliner passes to use the inline cost analysis. Doing so highlights how utterly redundant these two passes are. Either we should find a cheaper way to do always inlining, or we should merge the two and just fiddle with the thresholds to get the desired behavior. I'm leaning increasingly toward the latter as it would also remove the Inliner sub-class split. llvm-svn: 173030
* Formatting and comment fixes to the always inliner.Chandler Carruth2013-01-211-25/+28
| | | | | | Formatting fixes brought to you by clang-format. llvm-svn: 173029
* Clean up the formatting and doxygen for the simple inliner a bit. NoChandler Carruth2013-01-211-18/+29
| | | | | | functionality changed. llvm-svn: 173028
* Use AttributeSet accessor methods instead of Attribute accessor methods.Bill Wendling2013-01-181-10/+6
| | | | | | | Further encapsulation of the Attribute object. Don't allow direct access to the Attribute object as an aggregate. llvm-svn: 172853
* Push some more methods down to hide the use of the Attribute class.Bill Wendling2013-01-182-3/+3
| | | | | | | | Because the Attribute class is going to stop representing a collection of attributes, limit the use of it as an aggregate in favor of using AttributeSet. This replaces some of the uses for querying the function attributes. llvm-svn: 172844
* Remove redundant 'llvm::' qualificationsDmitri Gribenko2013-01-131-1/+1
| | | | llvm-svn: 172358
* GlobalOpt: Avoid jump on uninitialized value.Benjamin Kramer2013-01-121-1/+1
| | | | | | Found by valgrind. llvm-svn: 172318
* Fixed whitespace.Michael Gottesman2013-01-111-61/+61
| | | | llvm-svn: 172271
* Added debug messages to GlobalOpt.Michael Gottesman2013-01-111-17/+110
| | | | | | | | | Specifically: 1. Added a missing new line when we emit a debug message saying that we are marking a global variable as constant. 2. Added debug messages that describe what is occuring when GlobalOpt is evaluating a block/function. 3. Added a debug message that says what specific constructor is being evaluated. llvm-svn: 172247
* Fix TryToShrinkGlobalToBoolean in GlobalOpt, so that it does not discard ↵Joey Gouly2013-01-101-1/+2
| | | | | | address spaces. llvm-svn: 172051
* Move TypeFinder.h into the IR tree, it clearly belongs with the IR library.Chandler Carruth2013-01-071-1/+1
| | | | llvm-svn: 171749
* Move CallGraphSCCPass.h into the Analysis tree; that's where theChandler Carruth2013-01-073-3/+3
| | | | | | implementation lives already. llvm-svn: 171746
* Remove the long defunct 'DefaultPasses' header. We have a pass managerChandler Carruth2013-01-071-1/+0
| | | | | | | builder these days, and this thing hasn't seen updates for a very long time. llvm-svn: 171741
* Move the loop vectorizer from O2 to O3. It looks like the increase in code ↵Nadav Rotem2013-01-041-1/+1
| | | | | | size actually hurts the performance on many programs. llvm-svn: 171471
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-0218-76/+76
| | | | | | | | | | | | | | | | | | | | | 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
* convert a bunch of callers from DataLayout::getIndexedOffset() to ↵Nuno Lopes2012-12-301-7/+5
| | | | | | | | | GEP::accumulateConstantOffset(). The later API is nicer than the former, and is correct regarding wrap-around offsets (if anyone cares). There are a few more places left with duplicated code, which I'll remove soon. llvm-svn: 171259
* Remove Function::getParamAttributes and use the AttributeSet accessor ↵Bill Wendling2012-12-301-2/+2
| | | | | | methods instead. llvm-svn: 171255
* Remove the Function::getFnAttributes method in favor of using the AttributeSetBill Wendling2012-12-302-8/+16
| | | | | | | | | directly. This is in preparation for removing the use of the 'Attribute' class as a collection of attributes. That will shift to the AttributeSet class instead. llvm-svn: 171253
* Make this parameter be named consistently with most otherChandler Carruth2012-12-271-2/+2
| | | | | | getAnalysisUsage implementations. llvm-svn: 171157
* Remove duplicate includes.Roman Divacky2012-12-211-1/+0
| | | | llvm-svn: 170902
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-197-47/+47
| | | | | | single attribute in the future. llvm-svn: 170502
* Enable the loop vectorizer in clang and not in the pass manager, so that we ↵Nadav Rotem2012-12-181-1/+1
| | | | | | can disable it in clang. llvm-svn: 170470
* Enable the loop vectorizer.Nadav Rotem2012-12-181-1/+1
| | | | llvm-svn: 170416
* Revert r170246, "Enable the loop vectorizer by default."NAKAMURA Takumi2012-12-151-1/+1
| | | | llvm-svn: 170267
* Enable the loop vectorizer by default.Nadav Rotem2012-12-141-1/+1
| | | | llvm-svn: 170246
* revert r170166 - disable the loop vectorizer.Nadav Rotem2012-12-141-1/+1
| | | | llvm-svn: 170172
* Enable the loop vectorizer.Nadav Rotem2012-12-141-1/+1
| | | | llvm-svn: 170166
* Disable the loop vectorizer.Nadav Rotem2012-12-141-1/+1
| | | | llvm-svn: 170162
* Enable the Loop Vectorizer by default for O2 and O3. Disable if-conversion ↵Nadav Rotem2012-12-131-1/+1
| | | | | | by default. I plan to revert this patch later today. llvm-svn: 170157
* Take into account minimize size attribute in the inliner.Quentin Colombet2012-12-131-2/+4
| | | | | | | | | Better controls the inlining of functions when the caller function has MinSize attribute. Basically, when the caller function has this attribute, we do not "force" the inlining of callee functions carrying the InlineHint attribute (i.e., functions defined with inline keyword) llvm-svn: 170065
* LoopVectorizer: Use the "optsize" attribute to decide if we are allowed to ↵Nadav Rotem2012-12-121-1/+1
| | | | | | increase the function size. llvm-svn: 170004
OpenPOWER on IntegriCloud