summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
Commit message (Collapse)AuthorAgeFilesLines
* 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
* LoopVectorizer: When -Os is used, vectorize only loops that dont require a ↵Nadav Rotem2012-12-121-1/+1
| | | | | | tail loop. There is no testcase because I dont know of a way to initialize the loop vectorizer pass without adding an additional hidden flag. llvm-svn: 169950
* Use an ArrayRef instead of a std::vector&.Rafael Espindola2012-12-111-4/+4
| | | | llvm-svn: 169881
* Enable the loop vectorizer only on O2 and above. (Still disabled by default)Nadav Rotem2012-12-101-1/+1
| | | | llvm-svn: 169774
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-075-25/+25
| | | | | | in the near future. llvm-svn: 169651
* Remove unused field.Jakub Staszak2012-12-061-6/+1
| | | | llvm-svn: 169551
* Remove trailing spaces.Jakub Staszak2012-12-061-25/+25
| | | | llvm-svn: 169550
* Add 'using' declarations to suppress -Woverloaded-virtual warnings.Matt Beaumont-Gay2012-12-042-0/+5
| | | | llvm-svn: 169214
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-0319-95/+93
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Revert previous check in r168581, r169079 as they are still in code review ↵Zhou Sheng2012-12-011-22/+4
| | | | | | status. llvm-svn: 169083
* The patch is to improve the memory footprint of pass GlobalOpt. Zhou Sheng2012-12-011-4/+22
| | | | | | | | | | | | Also check in a case to repeat the issue, on which 'opt -globalopt' consumes 1.6GB memory. The big memory footprint cause is that current GlobalOpt one by one hoists and stores the leaf element constant into the global array, in each iteration, it recreates the global array initializer constant and leave the old initializer alone. This may result in many obsolete constants left. For example: we have global array @rom = global [16 x i32] zeroinitializer After the first element value is hoisted and installed: @rom = global [16 x i32] [ 1, 0, 0, ... ] After the second element value is installed: @rom = global [16 x 32] [ 1, 2, 0, 0, ... ] // here the previous initializer is obsolete ... When the transform is done, we have 15 obsolete initializers left useless. llvm-svn: 169079
* No need to run LICM after loop vectorization because we dont generate ↵Nadav Rotem2012-11-291-3/+1
| | | | | | invariant code any more. llvm-svn: 168928
* Make the AttrListPtr object a part of the LLVMContext.Bill Wendling2012-11-202-6/+8
| | | | | | | | | When code deletes the context, the AttributeImpls that the AttrListPtr points to are now invalid. Therefore, instead of keeping a separate managed static for the AttrListPtrs that's reference counted, move it into the LLVMContext and delete it when deleting the AttributeImpls. llvm-svn: 168354
* Clean up handling of always-inline functions in the inliner.Bob Wilson2012-11-191-44/+10
| | | | | | | | | This patch moves the isInlineViable function from the InlineAlways pass into the InlineCostAnalyzer and then changes the InlineCost computation to use that simple check for always-inline functions. All the special-case checks for AlwaysInline in the CallAnalyzer can then go away. llvm-svn: 168300
* Use empty parens for empty function parameter list instead of '(void)'.Dmitri Gribenko2012-11-151-1/+1
| | | | llvm-svn: 168049
* Make GlobalOpt be conservative with TLS variables (PR14309)Hans Wennborg2012-11-151-0/+9
| | | | | | | | | | | | | | For global variables that get the same value stored into them everywhere, GlobalOpt will replace them with a constant. The problem is that a thread-local GlobalVariable looks like one value (the address of the TLS var), but is different between threads. This patch introduces Constant::isThreadDependent() which returns true for thread-local variables and constants which depend on them (e.g. a GEP into a thread-local array), and teaches GlobalOpt not to track such values. llvm-svn: 168037
* Revert the series of commits starting with r166578 which introduced theChandler Carruth2012-11-012-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getIntPtrType support for multiple address spaces via a pointer type, and also introduced a crasher bug in the constant folder reported in PR14233. These commits also contained several problems that should really be addressed before they are re-committed. I have avoided reverting various cleanups to the DataLayout APIs that are reasonable to have moving forward in order to reduce the amount of churn, and minimize the number of commits that were reverted. I've also manually updated merge conflicts and manually arranged for the getIntPtrType function to stay in DataLayout and to be defined in a plausible way after this revert. Thanks to Duncan for working through this exact strategy with me, and Nick Lewycky for tracking down the really annoying crasher this triggered. (Test case to follow in its own commit.) After discussing with Duncan extensively, and based on a note from Micah, I'm going to continue to back out some more of the more problematic patches in this series in order to ensure we go into the LLVM 3.2 branch with a reasonable story here. I'll send a note to llvmdev explaining what's going on and why. Summary of reverted revisions: r166634: Fix a compiler warning with an unused variable. r166607: Add some cleanup to the DataLayout changes requested by Chandler. r166596: Revert "Back out r166591, not sure why this made it through since I cancelled the command. Bleh, sorry about this! r166591: Delete a directory that wasn't supposed to be checked in yet. r166578: Add in support for getIntPtrType to get the pointer type based on the address space. llvm-svn: 167221
* Replace some instances of UniqueVector with SetVector, which is slightly ↵Benjamin Kramer2012-10-311-3/+3
| | | | | | | | cheaper. No functionality change. llvm-svn: 167116
* 80-colNadav Rotem2012-10-301-1/+2
| | | | llvm-svn: 167036
* Rename the BB-vectorize flag to match the dragonegg nameNadav Rotem2012-10-291-2/+2
| | | | llvm-svn: 166948
* Change the PassManagerBuilder (used by -O3) loop vectorizer flag from ↵Nadav Rotem2012-10-291-4/+8
| | | | | | -vectorize to -vectorize-loops because we dont want to share the same flag as the bb-vectorizer. llvm-svn: 166937
* llvm-extract changes linkages so that functions on both sides of theRafael Espindola2012-10-291-12/+25
| | | | | | | split module can see each other. If it is keeping a symbol that already has a non local linkage, it doesn't need to change it. llvm-svn: 166908
* llvm-extract was unable to handle aliases. It would leave a copy on theRafael Espindola2012-10-291-0/+30
| | | | | | | | | | | | | | | | | | output of both llvm-extract foo.ll -func=bar and llvm-extract foo.ll -func=bar -delete so the two new files could not be linked together anymore. With this change alias are handled almost like functions and global variables. Almost because with alias we cannot just clear the initializer/body, we have to create a new declaration and replace the alias with it. The net result is that now the output of the above commands can be linked even if foo.ll has aliases. llvm-svn: 166907
* Change the internalize pass to internalize all symbols when given an emptyRafael Espindola2012-10-263-32/+18
| | | | | | | list of externals. This makes sense since a shared library with no symbols can still be useful if it has static constructors. llvm-svn: 166795
* revert accidental changeNadav Rotem2012-10-241-1/+1
| | | | llvm-svn: 166643
* Implement a basic cost model for vector and scalar instructions. Nadav Rotem2012-10-241-1/+1
| | | | llvm-svn: 166642
* Add in support for getIntPtrType to get the pointer type based on the ↵Micah Villmow2012-10-242-5/+4
| | | | | | | | | address space. This checkin also adds in some tests that utilize these paths and updates some of the clients. llvm-svn: 166578
* Introduce a BarrierNoop pass, a hack designed to allow *some* controlChandler Carruth2012-10-183-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | over the implicitly-formed-and-nesting CGSCC pass manager and function pass managers, especially when using them on the opt commandline or using extension points in the module builder. The '-barrier' opt flag (or the pass itself) will create a no-op module pass in the pipeline, resetting the pass manager stack, and allowing the creation of a new pipeline of function passes or CGSCC passes to be created that is independent from any previous pipelines. For example, this can be used to test running two CGSCC passes in independent CGSCC pass managers as opposed to in the same CGSCC pass manager. It also allows us to introduce a further hack into the PassManagerBuilder to separate the O0 pipeline extension passes from the always-inliner's CGSCC pass manager, which they likely do not want to participate in... At the very least none of the Sanitizer passes want this behavior. This fixes a bug with ASan at O0 currently, and I'll commit the ASan test which covers this pass. I'm happy to add a test case that this pass exists and works, but not sure how much time folks would like me to spend adding test cases for the details of its behavior of partition pass managers.... The whole thing is just vile, and mostly intended to unblock ASan, so I'm hoping to rip this all out in a brave new pass manager world. llvm-svn: 166172
* Add a loop vectorizer.Nadav Rotem2012-10-171-0/+6
| | | | llvm-svn: 166112
* Use the Attributes::get method which takes an AttrVal value directly to ↵Bill Wendling2012-10-161-4/+2
| | | | | | simplify the code a bit. No functionality change. llvm-svn: 166009
* Fix filename in file header.Craig Topper2012-10-161-1/+1
| | | | llvm-svn: 166004
* Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling2012-10-154-7/+7
| | | | | | own class named AttrBuilder. No functionality change. llvm-svn: 165960
* Add an enum for the return and function indexes into the AttrListPtr object. ↵Bill Wendling2012-10-153-11/+22
| | | | | | This gets rid of some magic numbers. llvm-svn: 165924
* Attributes RewriteBill Wendling2012-10-154-10/+13
| | | | | | | | | | Convert the internal representation of the Attributes class into a pointer to an opaque object that's uniqued by and stored in the LLVMContext object. The Attributes class then becomes a thin wrapper around this opaque object. Eventually, the internal representation will be expanded to include attributes that represent code generation options, etc. llvm-svn: 165917
* Remove operator cast method in favor of querying with the correct method.Bill Wendling2012-10-142-13/+24
| | | | llvm-svn: 165899
* Remove the bitwise AND operators from the Attributes class. Replace it with ↵Bill Wendling2012-10-141-2/+3
| | | | | | the equivalent from the builder class. llvm-svn: 165896
* Remove the bitwise assignment OR operator from the Attributes class. Replace ↵Bill Wendling2012-10-141-1/+2
| | | | | | it with the equivalent from the builder class. llvm-svn: 165895
* Remove the bitwise NOT operator from the Attributes class. Replace it with ↵Bill Wendling2012-10-142-6/+10
| | | | | | the equivalent from the builder class. llvm-svn: 165892
* Remove the final bits of Attributes being declared in the AttributeBill Wendling2012-10-102-8/+19
| | | | | | | namespace. Use the attribute's enum value instead. No functionality change intended. llvm-svn: 165610
* Have 'addFnAttr' take the attribute enum value. Then have it build the ↵Bill Wendling2012-10-101-2/+2
| | | | | | attribute object and add it appropriately. No functionality change. llvm-svn: 165595
OpenPOWER on IntegriCloud