summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/MergeFunctions.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add in support for getIntPtrType to get the pointer type based on the ↵Micah Villmow2012-10-241-3/+2
| | | | | | | | | address space. This checkin also adds in some tests that utilize these paths and updates some of the clients. llvm-svn: 166578
* Move TargetData to DataLayout.Micah Villmow2012-10-081-13/+13
| | | | llvm-svn: 165402
* Remove tabs.Bill Wendling2012-07-191-1/+1
| | | | llvm-svn: 160477
* Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth2012-06-291-6/+6
| | | | | | | | | | | | | | | | | This was always part of the VMCore library out of necessity -- it deals entirely in the IR. The .cpp file in fact was already part of the VMCore library. This is just a mechanical move. I've tried to go through and re-apply the coding standard's preferred header sort, but at 40-ish files, I may have gotten some wrong. Please let me know if so. I'll be committing the corresponding updates to Clang and Polly, and Duncan has DragonEgg. Thanks to Bill and Eric for giving the green light for this bit of cleanup. llvm-svn: 159421
* Update inter-procedural optimizations for atomic load/store.Eli Friedman2011-08-151-2/+6
| | | | llvm-svn: 137667
* Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to beEli Friedman2011-07-291-16/+16
| | | | | | | | | working on x86 (at least for trivial testcases); other architectures will need more work so that they actually emit the appropriate instructions for orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC, Mips, and Alpha backends need such changes.) llvm-svn: 136457
* Convert TargetData::getIndexedOffset to use ArrayRef.Jay Foad2011-07-191-2/+2
| | | | llvm-svn: 135478
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-13/+13
| | | | llvm-svn: 135375
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-1/+1
| | | | llvm-svn: 135265
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. llvm-svn: 134829
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-111-0/+1
| | | | llvm-svn: 129271
* No functionality change, just adjust some whitespace for coding style ↵Nick Lewycky2011-03-251-2/+2
| | | | | | compliance. llvm-svn: 128257
* Instead of keeping two Value*->id# mappings, keep one Value->Value mapping andNick Lewycky2011-02-201-12/+14
| | | | | | | one Value set. This is faster because we only need to use the set when there isn't already an entry in the map. No functionality change! llvm-svn: 126076
* When removing a function from the function set and adding it to deferred, weNick Lewycky2011-02-091-2/+19
| | | | | | | | | | | | | could end up removing a different function than we intended because it was functionally equivalent, then end up with a comparison of a function against itself in the next round of comparisons (the one in the function set and the one on the deferred list). To fix this, I introduce a choice in the form of comparison for ComparableFunctions, either normal or "pointer only" used to find exact Function*'s in lookups. Also add some debugging statements. llvm-svn: 125180
* Simplify away redundant test, and document what's going on.Nick Lewycky2011-02-061-2/+5
| | | | llvm-svn: 124977
* Remove specialized comparison of InlineAsm objects. They're uniqued on creationNick Lewycky2011-02-061-6/+2
| | | | | | now, and this wasn't comparing some of their relevant bits anyhow. llvm-svn: 124976
* Remove wasteful caching. This isn't needed for correctness because any functionNick Lewycky2011-02-021-23/+2
| | | | | | | | that might have changed been affected by a merge elsewhere will have been removed from the function set, and it isn't needed for performance because we call grow() ahead of time to prevent reallocations. llvm-svn: 124717
* Rename functions to follow coding standard. Also rejiggers comments. NoNick Lewycky2011-01-281-89/+88
| | | | | | functionality change. llvm-svn: 124482
* Add a doxygen comment for this class.Nick Lewycky2011-01-281-0/+2
| | | | llvm-svn: 124480
* Reorder for readability. (Chris, is this what you meant?)Nick Lewycky2011-01-281-148/+150
| | | | llvm-svn: 124479
* Reduce the number of functions we look at in the first pass, and preallocateNick Lewycky2011-01-281-1/+3
| | | | | | the function equality set. llvm-svn: 124475
* Unbreak the build.Benjamin Kramer2011-01-271-1/+1
| | | | llvm-svn: 124426
* Expound upon this comparison!Nick Lewycky2011-01-271-0/+2
| | | | llvm-svn: 124406
* Use dyn_cast instead of isa+cast.Nick Lewycky2011-01-271-2/+1
| | | | llvm-svn: 124404
* Fix surprising missed optimization in mergefunc where we forgot to considerNick Lewycky2011-01-271-3/+12
| | | | | | that relationships like "i8* null" is equivalent to "i32* null". llvm-svn: 124368
* AttrListPtr has an overloaded operator== which does this for us, we should useNick Lewycky2011-01-261-4/+2
| | | | | | it. No functionality change! llvm-svn: 124286
* Teach mergefunc that intptr_t is the same width as a pointer. We still can'tNick Lewycky2011-01-261-1/+7
| | | | | | | merge vector<intptr_t>::push_back() and vector<void*>::push_back() because Enumerate() doesn't realize that "i64* null" and "i8** null" are equivalent. llvm-svn: 124285
* There are no vectors of pointer or arrays, so we don't need to check vectorNick Lewycky2011-01-261-7/+1
| | | | | | elements for type equivalence. llvm-svn: 124284
* Teach mergefunc how to emit aliases safely again -- but keep it turned it offNick Lewycky2011-01-251-25/+79
| | | | | | | for now. It's controlled by the HasGlobalAliases variable which is not attached to any flag yet. llvm-svn: 124182
* Add a cache that protects mergefunc's internals from more surprises in DenseSet.Nick Lewycky2011-01-151-5/+27
| | | | | | Also, replace tabs with spaces. Yes, it's 2011. llvm-svn: 123535
* Also remove functions that use complex constant expressions in terms ofNick Lewycky2011-01-021-5/+18
| | | | | | another function. llvm-svn: 122705
* Remove functions from the FnSet when one of their callee's is being merged. ThisNick Lewycky2011-01-021-82/+66
| | | | | | | | | | | maintains the guarantee that the DenseSet expects two elements it contains to not go from inequal to equal under its nose. As a side-effect, this also lets us switch from iterating to a fixed-point to actually maintaining a work queue of functions to look at again, and we don't add thunks to our work queue so we don't need to detect and ignore them. llvm-svn: 122677
* RetOp is not actually used for anything useful (thoughDuncan Sands2010-10-211-2/+0
| | | | | | | it looks like maybe it was supposed to be used in the test...), so zap it (gcc-4.6 warning). llvm-svn: 117023
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+3
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Fix major bug in thunk detection. Also verify the calling convention.Nick Lewycky2010-09-071-22/+39
| | | | | | | | | Switch from isWeakForLinker to mayBeOverridden which is more accurate. Add more statistics and debugging info. Add comments. Move static function outside anonymous namespace. llvm-svn: 113190
* Switch FnSet to containing the ComparableFunction instead of a pointer to one.Nick Lewycky2010-09-051-36/+67
| | | | | | This reduces malloc traffic (yay!) and removes MergeFunctionsEqualityInfo. llvm-svn: 113105
* Fix many bugs when merging weak-strong and weak-weak pairs. We now merge allNick Lewycky2010-09-051-98/+183
| | | | | | | strong functions first to make sure they're the canonical definitions and then do a second pass looking only for weak functions. llvm-svn: 113104
* Fix an infinite loop; merging two functions will create a new function (if theNick Lewycky2010-08-311-31/+45
| | | | | | | | | two are weak, we make them thunks to a new strong function) so don't iterate through the function list as we're modifying it. Also add back the outermost loop which got removed during the cleanups. llvm-svn: 112595
* Switch to DenseSet, simplifying much more code. We now have a single iterationNick Lewycky2010-08-311-78/+83
| | | | | | | where we hash, compare and fold, instead of one iteration where we build up the hash buckets and a second one to fold. llvm-svn: 112582
* remove unions from LLVM IR. They are severely buggy and notChris Lattner2010-08-281-14/+0
| | | | | | being actively maintained, improved, or extended. llvm-svn: 112356
* Fix a use after free error caught by the valgrind builders.Nick Lewycky2010-08-091-2/+4
| | | | llvm-svn: 110601
* Do more to modernize MergeFunctions. Refactor in response to Chris' code review.Nick Lewycky2010-08-081-91/+81
| | | | llvm-svn: 110538
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110460
* Work in progress, cleaning up MergeFuncs.Nick Lewycky2010-08-061-180/+40
| | | | | | | | Further clean up the comparison function by removing overly generalized "domains". Remove all understanding of ELF aliases and simplify folding code and comments. llvm-svn: 110434
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-1/+1
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Fix a -Wreorder warning.Daniel Dunbar2010-08-021-1/+1
| | | | llvm-svn: 110022
* Work in progress.Nick Lewycky2010-08-021-129/+164
| | | | | | | | Start cleaning up MergeFunctions to look more like the rest of LLVM. The primary change here is to move the methods responsible for comparison into the new FunctionComparator object. Some comments added. There's more to do. llvm-svn: 110021
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-1/+1
| | | | llvm-svn: 109045
OpenPOWER on IntegriCloud