summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/GlobalOpt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Temporarily revert r65994. It was causing rdar://6646455.Bill Wendling2009-03-041-20/+6
| | | | llvm-svn: 66083
* If a global constant is dead then global's debug info should not prevent the ↵Devang Patel2009-03-041-6/+20
| | | | | | optimizer in deleting the global. And while deleting global, delete global's debug info also. llvm-svn: 65994
* 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
* 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
* 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
* Add the private linkage.Rafael Espindola2009-01-151-6/+6
| | | | 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
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-2/+2
| | | | | | suggested by Chris. llvm-svn: 62099
* Whitespace - correct formatting.Duncan Sands2009-01-071-2/+2
| | | | llvm-svn: 61879
* 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
* Large mechanical patch.Devang Patel2008-09-251-6/+6
| | | | | | | | | | | | | | | s/ParamAttr/Attribute/g s/PAList/AttrList/g s/FnAttributeWithIndex/AttributeWithIndex/g s/FnAttr/Attribute/g This sets the stage - to implement function notes as function attributes and - to distinguish between function attributes and return value attributes. This requires corresponding changes in llvm-gcc and clang. llvm-svn: 56622
* Make safer variant of alias resolution routine to be defaultAnton Korobeynikov2008-09-091-2/+1
| | | | llvm-svn: 56005
* Resolve aliases, when possibleAnton Korobeynikov2008-09-091-0/+22
| | | | llvm-svn: 56001
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Remove tabs.Bill Wendling2008-08-121-2/+2
| | | | llvm-svn: 54707
* Make GlobalOpt preserve address spaces when scalar replacing aggregate globals.Matthijs Kooijman2008-07-171-2/+4
| | | | llvm-svn: 53716
* convert more operand loops to iterator formulationGabor Greif2008-05-291-21/+26
| | | | llvm-svn: 51663
* Use isSingleValueType instead of isFirstClassType toDan Gohman2008-05-231-3/+3
| | | | | | exclude struct and array types. llvm-svn: 51459
* API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. ↵Gabor Greif2008-05-161-2/+2
| | | | | | Legacy interfaces will be in place for some time. (Merge from use-diet branch.) llvm-svn: 51200
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-151-1/+2
| | | | | | makefile targets to find these better. llvm-svn: 51143
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-4/+6
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* When SRoA'ing a global variable, make sure the new globals get the Chris Lattner2008-04-261-5/+32
| | | | | | | | | appropriate alignment. This fixes a miscompilation of 252.eon on x86-64 (rdar://5891920). Bill, please pull this into Tak. llvm-svn: 50308
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-18/+17
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* Don't include <map> in Pass.h, which doesn't need it. This requiresDan Gohman2008-03-211-0/+1
| | | | | | adding <map> to many files that actually do need it. llvm-svn: 48667
* Reimplement the parameter attributes support, phase #1. hilights:Chris Lattner2008-03-121-12/+5
| | | | | | | | | | | | | | | | | | | | | | | 1. There is now a "PAListPtr" class, which is a smart pointer around the underlying uniqued parameter attribute list object, and manages its refcount. It is now impossible to mess up the refcount. 2. PAListPtr is now the main interface to the underlying object, and the underlying object is now completely opaque. 3. Implementation details like SmallVector and FoldingSet are now no longer part of the interface. 4. You can create a PAListPtr with an arbitrary sequence of ParamAttrsWithIndex's, no need to make a SmallVector of a specific size (you can just use an array or scalar or vector if you wish). 5. All the client code that had to check for a null pointer before dereferencing the pointer is simplified to just access the PAListPtr directly. 6. The interfaces for adding attrs to a list and removing them is a bit simpler. Phase #2 will rename some stuff (e.g. PAListPtr) and do other less invasive changes. llvm-svn: 48289
* Split ParameterAttributes.h, putting the complicatedDale Johannesen2008-02-221-1/+1
| | | | | | | stuff into ParamAttrsList.h. Per feedback from ParamAttrs changes. llvm-svn: 47504
* Make Transforms to be 4.3 warnings-cleanAnton Korobeynikov2008-02-201-2/+4
| | | | llvm-svn: 47371
* Simplify caller updating using a CallSite, asDuncan Sands2008-02-181-22/+16
| | | | | | | | requested by Chris. While there, do the same for an existing function committed by someone called "lattner" :) llvm-svn: 47273
* Remove any 'nest' parameter attributes if the functionDuncan Sands2008-02-161-10/+52
| | | | | | is not passed as an argument to a trampoline intrinsic. llvm-svn: 47220
* Don't let globalopt hack on volatile loads or stores.Chris Lattner2008-01-291-1/+4
| | | | llvm-svn: 46523
* Fix the miscompilation of MiBench/consumer-lame that was exposed by Evan'sChris Lattner2008-01-141-59/+97
| | | | | | | byval work. This miscompilation is due to the program indexing an array out of range and us doing a transformation that broke this. llvm-svn: 45949
* The isNotSuitableForSRA property is now dead, don't compute it.Chris Lattner2008-01-141-45/+1
| | | | llvm-svn: 45948
* Change SRAGlobal to not depend on isNotSuitableForSRA, which makes it very Chris Lattner2008-01-141-2/+75
| | | | | | difficult to understand the invariants. llvm-svn: 45947
* Make the 'shrink global to bool' optimization more self contained, and thus Chris Lattner2008-01-141-10/+25
| | | | | | easier to show that its safe. No functionality change. llvm-svn: 45946
* Fix PR1896Chris Lattner2008-01-041-1/+1
| | | | llvm-svn: 45568
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-171-2/+2
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. llvm-svn: 45082
* Fix the regression on Transforms/GlobalOpt/deadglobal-2.ll from myChris Lattner2007-11-131-3/+3
| | | | | | patch on friday. llvm-svn: 44068
* Tighten up a check for folding away loads from (newly constant) globals. ThisChris Lattner2007-11-091-6/+11
| | | | | | | fixes a crash on Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll and rdar://5585488. llvm-svn: 43949
OpenPOWER on IntegriCloud