aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/IPO
Commit message (Collapse)AuthorAgeFilesLines
...
* rewrite OptimizeAwayTrappingUsesOfLoads to 1) avoid a temporaryChris Lattner2009-01-141-24/+26
| | | | | | | | | vector and extraneous loop over it, 2) not delete globals used by phis/selects etc which could actually be useful. This fixes PR3321. Many thanks to Duncan for narrowing this down. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62201 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct a comment.Duncan Sands2009-01-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62165 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable recursive inlining. Reduce inlining thresholdDale Johannesen2009-01-121-5/+5
| | | | | | | | | back to 200; 400 seems to be too high, loses more than it gains. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62107 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-2/+2
| | | | | | | suggested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62099 91177308-0d34-0410-b5e6-96231b3b80d8
* Increase default inlining aggressiveness in partialDale Johannesen2009-01-111-2/+2
| | | | | | | | | | | compensation for turning off gcc's inliner. This gets us closer to the amount of inlining we were getting before. It is not a win on everything, of course, but seems to gain overall. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62058 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed trailing whitespace from Makefiles.Misha Brukman2009-01-091-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61991 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjustments to last patch based on review.Dale Johannesen2009-01-093-0/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61969 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace - correct formatting.Duncan Sands2009-01-071-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61879 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove alloca tracking from nocapture analysis. Not onlyDuncan Sands2009-01-071-69/+16
| | | | | | | | | | | was it not very helpful, it was also wrong! The problem is shown in the testcase: the alloca might be passed to a nocapture callee which dereferences it and returns the original pointer. But because it was a nocapture call we think we don't need to track its uses, but we do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61876 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorder these.Duncan Sands2009-01-071-24/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61873 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a switch rather than a sequence of "isa" tests.Duncan Sands2009-01-071-16/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61872 91177308-0d34-0410-b5e6-96231b3b80d8
* The verifier checks that the aliasee is not null.Duncan Sands2009-01-071-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61870 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the internalize pass to also internalizeDuncan Sands2009-01-051-0/+12
| | | | | | | global aliases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61754 91177308-0d34-0410-b5e6-96231b3b80d8
* Not having an aliasee is a theoretical possibility.Duncan Sands2009-01-051-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61745 91177308-0d34-0410-b5e6-96231b3b80d8
* Format more neatly.Duncan Sands2009-01-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61744 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing spaces.Duncan Sands2009-01-051-10/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61743 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete unused global aliases with internal linkage.Duncan Sands2009-01-051-8/+23
| | | | | | | | | In fact this also deletes those with linkonce linkage, however this is currently dead because for the moment aliases aren't allowed to have this linkage type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61742 91177308-0d34-0410-b5e6-96231b3b80d8
* Any void readonly functions are provably dead, don't waste time adding Nick Lewycky2009-01-031-14/+0
| | | | | | | nocapture attributes to them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61610 91177308-0d34-0410-b5e6-96231b3b80d8
* Load tracking means that the value analyzed mayDuncan Sands2009-01-021-2/+8
| | | | | | | | | | | | | not have pointer type. In particular, it may be the condition argument for a select or a GEP index. While I was unable to construct a testcase for which some bits of the original pointer are captured due to one of these, it's very very close to being possible - so play safe and exclude these possibilities. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61580 91177308-0d34-0410-b5e6-96231b3b80d8
* When calculating 'nocapture' argument attributes, allowDuncan Sands2009-01-021-21/+60
| | | | | | | | | | | | | the argument to be stored to an alloca by tracking uses of the alloca. This occurs 4 times (out of 7121, 0.05%) in MultiSource/Applications, so may not be worth it. On the other hand, it is easy to do and fairly cheap. The functions it helps are: W_addcom and W_addlit in spiff; process_args (argv) in d (make_dparser); ercPixConcealIMB in JM/ldecod. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61570 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve comments and reorganize a bit - no functionalityDuncan Sands2009-01-021-56/+44
| | | | | | | change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61569 91177308-0d34-0410-b5e6-96231b3b80d8
* Make adding nocapture a bit stronger. FreeInst is nocapture. Also, Nick Lewycky2009-01-021-3/+27
| | | | | | | | | | | functions that don't write can't leak a pointer except through the return value, so a void readonly function is implicitly nocapture. Test these, and add a test that verifies that f1 calling f2 with an otherwise dead pointer gets both of them marked nocapture. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61552 91177308-0d34-0410-b5e6-96231b3b80d8
* Mention that this pass does escape analysis in theDuncan Sands2009-01-011-3/+5
| | | | | | | leading comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61548 91177308-0d34-0410-b5e6-96231b3b80d8
* Look through phi nodes and select instructions whenDuncan Sands2008-12-311-3/+8
| | | | | | | calculating nocapture attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61535 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't analyze arguments already marked 'nocapture'.Duncan Sands2008-12-311-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61532 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename AddReadAttrs to FunctionAttrs, and teach it howDuncan Sands2008-12-312-13/+127
| | | | | | | | | to work out (in a very simplistic way) which function arguments (pointer arguments only) are only dereferenced and so do not escape. Mark such arguments 'nocapture'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61525 91177308-0d34-0410-b5e6-96231b3b80d8
* Experiments show that looking through phi nodesDuncan Sands2008-12-291-0/+2
| | | | | | | | | | | and select instructions doesn't buy anything here except extra complexity: the only difference in the entire testsuite was that a readonly function became readnone in MiBench/consumer-typeset. Add a comment about this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61478 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow readnone functions to read (and write!) globalDuncan Sands2008-12-291-4/+19
| | | | | | | | | | | | | | | | | constants, since doing so is irrelevant for aliasing purposes. While this doesn't increase the total number of functions marked readonly or readnone in MultiSource/ Applications (3089), it does result in 12 functions being marked readnone rather than readonly. Before: readnone: 820 readonly: 2269 After: readnone: 832 readonly: 2257 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61469 91177308-0d34-0410-b5e6-96231b3b80d8
* insert some sequence points and preincrement an iterator to avoidChris Lattner2008-12-171-7/+8
| | | | | | | iterator invalidation problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61124 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance heap sra to be substantially more aggressive w.r.t PHIChris Lattner2008-12-171-105/+182
| | | | | | | | | | nodes. This allows it to do fairly general phi insertion if a load from a pointer global wants to be SRAd but the load is used by (recursive) phi nodes. This fixes a pessimization on ppc introduced by Load PRE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61123 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix another crash found by inspection. If we have a PHI node mergingChris Lattner2008-12-161-47/+68
| | | | | | | | the load multiple times, make sure the check the uses of the PHI to ensure they are transformable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61102 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a crash found by inspection.Chris Lattner2008-12-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61101 91177308-0d34-0410-b5e6-96231b3b80d8
* switch some std::set/std::map to SmallPtrSet/DenseMap.Chris Lattner2008-12-161-14/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61081 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance heap-sra to apply to fixed sized array allocations, not justChris Lattner2008-12-151-4/+43
| | | | | | | variable sized array allocations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61051 91177308-0d34-0410-b5e6-96231b3b80d8
* Use stripPointerCasts.Chris Lattner2008-12-151-7/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61047 91177308-0d34-0410-b5e6-96231b3b80d8
* minor tweaks for formatting, allow bitcast in ↵Chris Lattner2008-12-151-12/+29
| | | | | | ValueIsOnlyUsedLocallyOrStoredToOneGlobal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61046 91177308-0d34-0410-b5e6-96231b3b80d8
* refactor some code into a new TryToOptimizeStoreOfMallocToGlobal function.Chris Lattner2008-12-151-62/+66
| | | | | | | Use GetElementPtrInst::hasAllZeroIndices where possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61045 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix error where it wasn't getting the correct caller function.Bill Wendling2008-11-211-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59758 91177308-0d34-0410-b5e6-96231b3b80d8
* If the function being inlined has a higher stack protection level than theBill Wendling2008-11-211-0/+9
| | | | | | | | inlining function, then increase the stack protection level on the inlining function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59757 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not forget llvm.dbg.declare's first argument while removing debugging ↵Devang Patel2008-11-201-4/+12
| | | | | | information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59688 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused variables.Devang Patel2008-11-191-12/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59570 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo.Devang Patel2008-11-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59569 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new helper pass that strips all symbol names except debugging information.Devang Patel2008-11-181-28/+51
| | | | | | | This pass makes it easier to test wheter debugging info. influences optimization passes or not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59552 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove even more llvm.dbg variables.Devang Patel2008-11-181-33/+50
| | | | | | | | Remove all dead globals from llvm.metadata. Ignore linkonce linkage for selected llvm.dbg values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59547 91177308-0d34-0410-b5e6-96231b3b80d8
* If SI->size() is 0, we are not allowed to dereference ->begin().Edwin Török2008-11-161-2/+4
| | | | | | | | This fixed PR3078. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59416 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify loopChris Lattner2008-11-161-5/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59406 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code.Devang Patel2008-11-141-37/+60
| | | | | | | Strip debug information before stripping symbol names. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59328 91177308-0d34-0410-b5e6-96231b3b80d8
* Really remove all debug information.Devang Patel2008-11-131-11/+52
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59208 91177308-0d34-0410-b5e6-96231b3b80d8
* Use actual function name in comments.Devang Patel2008-11-111-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59063 91177308-0d34-0410-b5e6-96231b3b80d8
* Do now allow InlineAlways pass to remove dead functions.Devang Patel2008-11-052-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58744 91177308-0d34-0410-b5e6-96231b3b80d8