aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Value.cpp
Commit message (Collapse)AuthorAgeFilesLines
* simplify code, improve a comment.Chris Lattner2007-08-211-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41205 91177308-0d34-0410-b5e6-96231b3b80d8
* add Value::getNameStart/getNameLen() accessors.Chris Lattner2007-08-101-0/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40989 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a nasty memory leak, caused by my revamp of the value symbol table.Chris Lattner2007-03-201-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35195 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak VC++ build.Jeff Cohen2007-03-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite Value::takeName to take advantage of the new symtab stuff. ThisChris Lattner2007-02-151-6/+55
| | | | | | | | causes it to require no allocations and no symtab lookups in the common case. This speeds up instcombine 9.2% on 447.dealII. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34324 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new Value::getNameStr method, which is preferred over getName.Chris Lattner2007-02-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34310 91177308-0d34-0410-b5e6-96231b3b80d8
* add a setName variant that takes a null-terminated string. This can beChris Lattner2007-02-131-0/+4
| | | | | | | used to avoid std::string allocations in common cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34232 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new setName accessor which doesn't require creating a string.Chris Lattner2007-02-121-20/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34197 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch ValueSymbolTable to use StringMap<Value*> instead of ↵Chris Lattner2007-02-121-19/+50
| | | | | | | | | | std::map<std::string, Value*> as its main datastructure. There are many improvements yet to be made, but this speeds up opt --std-compile-opts on 447.dealII by 7.3%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34193 91177308-0d34-0410-b5e6-96231b3b80d8
* fix uninitialized variableChris Lattner2007-02-111-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34182 91177308-0d34-0410-b5e6-96231b3b80d8
* add an optimization for the case where the src has no nameChris Lattner2007-02-111-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34174 91177308-0d34-0410-b5e6-96231b3b80d8
* add a helper method: Value::takeNameChris Lattner2007-02-111-12/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34171 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate ValueSymbolTable::rename, it has no advantage over using ↵Chris Lattner2007-02-071-1/+3
| | | | | | | | | remove+insert. Make insert/remove assert if used incorrectly instead of returning a bool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33988 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR411:Reid Spencer2007-02-051-6/+9
| | | | | | | | | | | This patch replaces the SymbolTable class with ValueSymbolTable which does not support types planes. This means that all symbol names in LLVM must now be unique. The patch addresses the necessary changes to deal with this and removes code no longer needed as a result. This completes the bulk of the changes for this PR. Some cleanup patches will follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR411:Reid Spencer2007-01-061-4/+4
| | | | | | | | | | Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32956 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed iostream #includes. Replaced std::cerr with DOUT.Bill Wendling2006-11-171-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31814 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the signature of replaceUsesOfWithOnConstant. The bool was alwaysChris Lattner2005-10-041-1/+1
| | | | | | | | true dynamically. Finally, pass the Use* that replaceAllUsesWith has into the method for future use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23626 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-211-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
* This fixes PR531, a crash when running the CBE on a bytecode file.Chris Lattner2005-03-061-4/+14
| | | | | | | | | | | | | | | | | | | The problem is that Function::renameLocalSymbols is iterating through the symbol table planes, occasionally calling setName to rename a value (which used to do a symbol table remove/insert pair). The problem is that if there is only a single value in a particular type plane that the remove will nuke the symbol table plane, and the insert will create and insert a new one. This hoses Function::renameLocalSymbols because it has an iterator to the old plane, under the (very reasonable) assumption that simply renaming a value won't cause the type plane to disappear. This patch fixes the bug by making the rename operation a single atomic operation, which has a side effect of making the whole thing faster too. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20469 91177308-0d34-0410-b5e6-96231b3b80d8
* remove all of the various setName implementations, consolidating them intoChris Lattner2005-03-051-3/+28
| | | | | | | Value::setName, which is no longer virtual. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20464 91177308-0d34-0410-b5e6-96231b3b80d8
* new methodChris Lattner2005-02-231-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20288 91177308-0d34-0410-b5e6-96231b3b80d8
* Initialize new field.Chris Lattner2005-02-051-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20044 91177308-0d34-0410-b5e6-96231b3b80d8
* Updates for new use list changes.Chris Lattner2005-02-011-6/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19961 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a space between the type and name of value when printing error messageMisha Brukman2004-10-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17022 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes For Bug 352Reid Spencer2004-09-011-1/+1
| | | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
* Use name.empty() instead of testing against equality with the emptyAlkis Evlogimenos2004-07-251-1/+1
| | | | | | | string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15191 91177308-0d34-0410-b5e6-96231b3b80d8
* Disallow creation of named values of type void.Alkis Evlogimenos2004-07-251-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15190 91177308-0d34-0410-b5e6-96231b3b80d8
* bug 122:Reid Spencer2004-07-181-2/+7
| | | | | | | - Correct isa<Constant> for GlobalValue subclass git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14933 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix regressions in these testcases:Chris Lattner2004-07-071-1/+2
| | | | | | | | | | Regression.Assembler.2002-01-24-BadSymbolTableAssert Regression.Assembler.2002-01-24-ValueRefineAbsType Found through the nightly tester :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14671 91177308-0d34-0410-b5e6-96231b3b80d8
* Find bugs sooner rather than later. In this case, don't allow the creationChris Lattner2004-07-061-0/+3
| | | | | | | of instructions that don't have a first-class or void type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14646 91177308-0d34-0410-b5e6-96231b3b80d8
* - #include <iostream> since its not in Value.h any more.Reid Spencer2004-07-041-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14617 91177308-0d34-0410-b5e6-96231b3b80d8
* User ctor is now inlineChris Lattner2004-06-271-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14431 91177308-0d34-0410-b5e6-96231b3b80d8
* Instancevar was renamedChris Lattner2004-06-261-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14428 91177308-0d34-0410-b5e6-96231b3b80d8
* Finegrainify namespacificationChris Lattner2003-11-211-4/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10131 91177308-0d34-0410-b5e6-96231b3b80d8
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
* If we're not checking, don't check!Chris Lattner2003-11-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9732 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-201-0/+7
| | | | | | | Header files will be on the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
* Completely rewrite support for the Value::use_* list. Now, all operations onChris Lattner2003-10-161-37/+11
| | | | | | | | | | | | | | | | | | | | this list (except use_size()) are constant time. Before the killUse method (used whenever something stopped using a value) was linear time, and thus very very slow for large programs. This speeds GCCAS up _substantially_ on large programs: almost 2x for 176.gcc: 176.gcc: 77.07s -> 37.38s 177.mesa: 7.59s -> 5.57s 252.eon: 21.02s -> 19.52s (*) 253.perlbmk: 11.40s -> 13.05s 254.gap: 7.25s -> 7.42s 252.eon would speed up a whole lot more, but optimization time is being dominated by the inlining pass, which needs to be fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9160 91177308-0d34-0410-b5e6-96231b3b80d8
* Users can never be nullChris Lattner2003-10-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8895 91177308-0d34-0410-b5e6-96231b3b80d8
* There is no reason for Value to be an AbstractTypeUser. This just makes thingsChris Lattner2003-10-021-14/+2
| | | | | | | | significantly more complete. Instead, just make DerivedType's AbstractTypeUser's, and make Value contain a PATypeHolder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8828 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: Linker/2003-08-28-TypeResolvesGlobal3.llChris Lattner2003-08-291-1/+1
| | | | | | | Use new replaceAllUsesWith stuff in a way that works even though types have not yet been propagated git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8210 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code to make it useful outside of Constants.cppChris Lattner2003-08-291-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8205 91177308-0d34-0410-b5e6-96231b3b80d8
* Make assertion more descriptiveChris Lattner2003-06-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6889 91177308-0d34-0410-b5e6-96231b3b80d8
* This speeds up processing LLVM a _lot_, 17% in the case of loading and ↵Chris Lattner2003-02-131-1/+2
| | | | | | destroying "vortex" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5553 91177308-0d34-0410-b5e6-96231b3b80d8
* - Make Value::replaceAllUsesWith work with constants correctly. This fixesChris Lattner2002-10-091-16/+18
| | | | | | | bug FuncResolve/2002-08-19-ResolveGlobalVars.ll and gzip looks better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4103 91177308-0d34-0410-b5e6-96231b3b80d8
* - Remove Value::use_removeChris Lattner2002-10-091-7/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4090 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix NASTY N^2 behavior that was causing the gzip benchmark to take forever toChris Lattner2002-10-081-6/+12
| | | | | | | | assemble. Now we scan the use-list from the back when removing users instead of from the front. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4086 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable "garbage detection" of LLVM objects. Now users should be obnoxiousChris Lattner2002-09-081-0/+4
| | | | | | | warnings. If they accidentally leak LLVM Value's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3620 91177308-0d34-0410-b5e6-96231b3b80d8
* *** empty log message ***Chris Lattner2002-07-241-13/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3065 91177308-0d34-0410-b5e6-96231b3b80d8
* *** empty log message ***Chris Lattner2002-06-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2813 91177308-0d34-0410-b5e6-96231b3b80d8