summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Value.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify by using no-op-when-not-multithreaded locks.Owen Anderson2009-06-181-13/+8
| | | | llvm-svn: 73719
* Move Threading.[h|cpp] from Support to System.Owen Anderson2009-06-181-1/+1
| | | | llvm-svn: 73707
* Protect the ValueHandle table.Owen Anderson2009-06-171-2/+19
| | | | llvm-svn: 73620
* Use true instead of 1 for a boolean value. And fix a copy+pastoDan Gohman2009-05-041-3/+3
| | | | | | in a comment. llvm-svn: 70882
* Apply Jeffrey Yasskin's CallbackVH patch, with minor tweaks from meDan Gohman2009-05-021-2/+10
| | | | | | | to make the copy constructor and destructor protected, and corresponding adjustments to the unittests. llvm-svn: 70644
* Limit the number of times we're willing to chase pointers. Removes an O(n^2)Nick Lewycky2009-04-151-1/+3
| | | | | | problem from instcombine. llvm-svn: 69151
* Add two new classes: WeakVH and AssertingVH. These are both "ValueHandles", Chris Lattner2009-03-311-2/+165
| | | | | | | | | | | | | | | | | | which are effectively smart pointers to Value*'s. They are both very light weight and simple, and react to values being destroyed or being RAUW'd. WeakVN does a best effort to follow a value around, including through RAUW operations and will get nulled out of the value is destroyed. This is useful for the eventual "metadata that references a value" work, because it is a reference to a value that does not show up on its use_* list. AssertingVH is a pointer that compiles down to a dumb raw pointer when assertions are disabled. When enabled, it emits an assertion if the pointed-to value is destroyed while it is still being referenced. This is very useful for Maps and other things, and should have caught the recent bugs in CallGraph and Reassociate, for example. llvm-svn: 68149
* Rearrange operands of the BranchInst, to be able toGabor Greif2009-03-121-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | access each with a fixed negative index from op_end(). This has two important implications: - getUser() will work faster, because there are less iterations for the waymarking algorithm to perform. This is important when running various analyses that want to determine callers of basic blocks. - getSuccessor() now runs faster, because the indirection via OperandList is not necessary: Uses corresponding to the successors are at fixed offset to "this". The price we pay is the slightly more complicated logic in the operator User::delete, as it has to pick up the information whether it has to free the memory of an original unconditional BranchInst or a BranchInst that was originally conditional, but has been shortened to unconditional. I was not able to come up with a nicer solution to this problem. (And rest assured, I tried *a lot*). Similar reorderings will follow for InvokeInst and CallInst. After that some optimizations to pred_iterator and CallSite will fall out naturally. llvm-svn: 66815
* Make stripPointerCasts and getUnderlyingObjectDuncan Sands2008-12-291-26/+39
| | | | | | non-recursive. llvm-svn: 61479
* These messages should always be emitted when NDEBUG is unset, not whenChris Lattner2008-12-131-2/+2
| | | | | | NDEBUG is unset and -debug is passed. llvm-svn: 60986
* Comment typeo fix, thanks Duncan!Chris Lattner2008-12-021-1/+1
| | | | llvm-svn: 60429
* add a little helper function that does PHI translation.Chris Lattner2008-12-021-0/+13
| | | | llvm-svn: 60405
* Factorize code: remove variants of "strip offDuncan Sands2008-10-011-8/+21
| | | | | | | | | | | pointer bitcasts and GEP's", and centralize the logic in Value::getUnderlyingObject. The difference with stripPointerCasts is that stripPointerCasts only strips GEPs if all indices are zero, while getUnderlyingObject strips GEPs no matter what the indices are. llvm-svn: 56922
* Make pointer parameter const for isUsedInBasicBlock.Bill Wendling2008-09-251-1/+1
| | | | llvm-svn: 56625
* backing out my last commit, it was not intended to go on the trunkGabor Greif2008-09-191-2/+2
| | | | llvm-svn: 56349
* first shot at removing Use::ValGabor Greif2008-09-191-2/+2
| | | | | | untested, Use::swap() is definitely not done yet llvm-svn: 56348
* Rename instance variables, parameter argument names to eliminate a bunch of ↵Evan Cheng2008-07-241-5/+5
| | | | | | compilation warnings with -Wshadow. llvm-svn: 53970
* fix some warnings when assertions are disabled.Chris Lattner2008-06-211-1/+1
| | | | llvm-svn: 52587
* Do not speculatively execute an instruction by hoisting it to its ↵Evan Cheng2008-06-121-0/+11
| | | | | | predecessor BB if any of its operands are defined but not used in BB. The transformation will prevent the operand from being sunk into the use block. llvm-svn: 52244
* Move the operator new and operator delete out of line. This fixes an issue withNate Begeman2008-05-151-0/+19
| | | | | | | operator new() referring to the static initTags function, which has to be in the same linkage unit as any file including User.h. llvm-svn: 51136
* Turn StripPointerCast() into a methodAnton Korobeynikov2008-05-071-28/+24
| | | | llvm-svn: 50836
* Make StripPointerCast a common function (should we mak it method of Value ↵Anton Korobeynikov2008-05-061-0/+28
| | | | | | instead?) llvm-svn: 50775
* fix a bug in my previous patch, a classic =/== bug.Chris Lattner2008-04-301-1/+1
| | | | llvm-svn: 50483
* add a method for comparing to see if a value has a specified name.Chris Lattner2008-04-301-0/+7
| | | | llvm-svn: 50465
* Print the name, not a pointer.Nick Lewycky2008-03-011-1/+1
| | | | llvm-svn: 47796
* Let invoke return aggregate value.Devang Patel2008-02-211-1/+1
| | | | llvm-svn: 47425
* Let function call return aggregate.Devang Patel2008-02-211-1/+6
| | | | | | Now, we have very first multiple return value testcase! llvm-svn: 47424
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-201-1/+1
| | | | | | annoying warnings. llvm-svn: 47367
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Reverting dtor devirtualization patch.Gordon Henriksen2007-12-101-200/+8
| | | | | | | _sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed _sabre_: the vtable lives to fight another day llvm-svn: 44760
* fix some warnings.Chris Lattner2007-12-101-15/+12
| | | | llvm-svn: 44756
* Fix a big problem in the recent dtor refactoring work, now it passes ↵Chris Lattner2007-12-101-50/+14
| | | | | | 2007-11-19-InlineAsm.ll llvm-svn: 44755
* Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!Gordon Henriksen2007-12-091-8/+239
| | | | llvm-svn: 44747
* Use empty() member functions when that's what's being tested for insteadDan Gohman2007-10-031-2/+2
| | | | | | of comparing begin() and end(). llvm-svn: 42585
* Make Value::getNameLen not crash on an empty name, fixing PR1712.Chris Lattner2007-09-281-1/+1
| | | | llvm-svn: 42444
* simplify code, improve a comment.Chris Lattner2007-08-211-6/+6
| | | | llvm-svn: 41205
* add Value::getNameStart/getNameLen() accessors.Chris Lattner2007-08-101-0/+15
| | | | llvm-svn: 40989
* Fix a nasty memory leak, caused by my revamp of the value symbol table.Chris Lattner2007-03-201-0/+5
| | | | llvm-svn: 35195
* Unbreak VC++ build.Jeff Cohen2007-03-051-1/+1
| | | | llvm-svn: 34917
* 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. llvm-svn: 34324
* Add a new Value::getNameStr method, which is preferred over getName.Chris Lattner2007-02-151-1/+1
| | | | llvm-svn: 34310
* 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. llvm-svn: 34232
* Add new setName accessor which doesn't require creating a string.Chris Lattner2007-02-121-20/+28
| | | | llvm-svn: 34197
* 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%. llvm-svn: 34193
* fix uninitialized variableChris Lattner2007-02-111-0/+1
| | | | llvm-svn: 34182
* add an optimization for the case where the src has no nameChris Lattner2007-02-111-0/+6
| | | | llvm-svn: 34174
* add a helper method: Value::takeNameChris Lattner2007-02-111-12/+26
| | | | llvm-svn: 34171
* 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. llvm-svn: 33988
* 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. llvm-svn: 33918
* 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. llvm-svn: 32956
OpenPOWER on IntegriCloud