summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
Commit message (Collapse)AuthorAgeFilesLines
* In theory the aliasee may have dead constant usersDuncan Sands2009-02-181-0/+1
| | | | | | | | here. Since we only do the transform if there is one use, strip off any such users in the hope of making the transform fire more often. llvm-svn: 64926
* Add explicit keywords.Dan Gohman2009-02-181-2/+2
| | | | llvm-svn: 64915
* If an alias is dead and so is its aliasee, then globaldce wouldDuncan Sands2009-02-171-8/+16
| | | | | | | crash because the alias would still be using the aliasee when the aliasee was deleted. llvm-svn: 64844
* This transform also applies to private linkage.Duncan Sands2009-02-171-2/+2
| | | | llvm-svn: 64773
* Make this more useful for cleaning up after theDuncan Sands2009-02-151-15/+5
| | | | | | | one-definition-rule llvm-gcc changes (coming soon to a tree near you!). llvm-svn: 64588
* If the target of an alias has internal linkage, then theDuncan Sands2009-02-151-7/+55
| | | | | | | | alias can be morphed into the target. Implement this transform, and fix a crash in the existing transform at the same time. llvm-svn: 64583
* Rename getAnalysisToUpdate to getAnalysisIfAvailable.Duncan Sands2009-01-281-1/+1
| | | | llvm-svn: 63198
* The function that does nothing but call malloc is noalias return.Nick Lewycky2009-01-251-5/+6
| | | | llvm-svn: 62956
* use CallSite::isCalle instead of slow getOperandNoGabor Greif2009-01-231-3/+3
| | | | llvm-svn: 62877
* Simplify the logic of getting hold of a PHI predecessor block.Gabor Greif2009-01-231-2/+1
| | | | | | | | | There is now a direct way from value-use-iterator to incoming block in PHINode's API. This way we avoid the iterator->index->iterator trip, and especially the costly getOperandNo() invocation. Additionally there is now an assertion that the iterator really refers to one of the PHI's Uses. llvm-svn: 62869
* introduce a useful abstraction to find out if a Use is in the call position ↵Gabor Greif2009-01-223-8/+6
| | | | | | of an instruction llvm-svn: 62788
* BasicAliasAnalysis and FunctionAttrs were bothDuncan Sands2009-01-181-81/+2
| | | | | | | | | doing very similar pointer capture analysis. Factor out the common logic. The new version is from FunctionAttrs since it does a better job than the version in BasicAliasAnalysis llvm-svn: 62461
* Add the private linkage.Rafael Espindola2009-01-1512-28/+31
| | | | llvm-svn: 62279
* 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. llvm-svn: 62201
* Correct a comment.Duncan Sands2009-01-131-1/+1
| | | | llvm-svn: 62165
* 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. llvm-svn: 62107
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-2/+2
| | | | | | suggested by Chris. llvm-svn: 62099
* 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. llvm-svn: 62058
* Removed trailing whitespace from Makefiles.Misha Brukman2009-01-091-2/+2
| | | | llvm-svn: 61991
* Adjustments to last patch based on review.Dale Johannesen2009-01-093-0/+11
| | | | llvm-svn: 61969
* Whitespace - correct formatting.Duncan Sands2009-01-071-2/+2
| | | | llvm-svn: 61879
* 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. llvm-svn: 61876
* Reorder these.Duncan Sands2009-01-071-24/+24
| | | | llvm-svn: 61873
* Use a switch rather than a sequence of "isa" tests.Duncan Sands2009-01-071-16/+32
| | | | llvm-svn: 61872
* The verifier checks that the aliasee is not null.Duncan Sands2009-01-071-2/+1
| | | | llvm-svn: 61870
* Teach the internalize pass to also internalizeDuncan Sands2009-01-051-0/+12
| | | | | | global aliases. llvm-svn: 61754
* Not having an aliasee is a theoretical possibility.Duncan Sands2009-01-051-1/+2
| | | | llvm-svn: 61745
* Format more neatly.Duncan Sands2009-01-051-1/+1
| | | | llvm-svn: 61744
* Remove trailing spaces.Duncan Sands2009-01-051-10/+10
| | | | llvm-svn: 61743
* 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. llvm-svn: 61742
* Any void readonly functions are provably dead, don't waste time adding Nick Lewycky2009-01-031-14/+0
| | | | | | nocapture attributes to them. llvm-svn: 61610
* 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. llvm-svn: 61580
* 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. llvm-svn: 61570
* Improve comments and reorganize a bit - no functionalityDuncan Sands2009-01-021-56/+44
| | | | | | change. llvm-svn: 61569
* 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. llvm-svn: 61552
* Mention that this pass does escape analysis in theDuncan Sands2009-01-011-3/+5
| | | | | | leading comments. llvm-svn: 61548
* Look through phi nodes and select instructions whenDuncan Sands2008-12-311-3/+8
| | | | | | calculating nocapture attributes. llvm-svn: 61535
* Don't analyze arguments already marked 'nocapture'.Duncan Sands2008-12-311-1/+2
| | | | llvm-svn: 61532
* 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'. llvm-svn: 61525
* 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. llvm-svn: 61478
* 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 llvm-svn: 61469
* insert some sequence points and preincrement an iterator to avoidChris Lattner2008-12-171-7/+8
| | | | | | iterator invalidation problems. llvm-svn: 61124
* 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. llvm-svn: 61123
* 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. llvm-svn: 61102
* fix a crash found by inspection.Chris Lattner2008-12-161-1/+1
| | | | llvm-svn: 61101
* switch some std::set/std::map to SmallPtrSet/DenseMap.Chris Lattner2008-12-161-14/+13
| | | | llvm-svn: 61081
* enhance heap-sra to apply to fixed sized array allocations, not justChris Lattner2008-12-151-4/+43
| | | | | | variable sized array allocations. llvm-svn: 61051
* Use stripPointerCasts.Chris Lattner2008-12-151-7/+2
| | | | llvm-svn: 61047
* minor tweaks for formatting, allow bitcast in ↵Chris Lattner2008-12-151-12/+29
| | | | | | ValueIsOnlyUsedLocallyOrStoredToOneGlobal. llvm-svn: 61046
* refactor some code into a new TryToOptimizeStoreOfMallocToGlobal function.Chris Lattner2008-12-151-62/+66
| | | | | | Use GetElementPtrInst::hasAllZeroIndices where possible. llvm-svn: 61045
OpenPOWER on IntegriCloud