Commit Graph

40 Commits

Author SHA1 Message Date
Chris Lattner
7ed47a1335 Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 19:59:42 +00:00
Gordon Henriksen
afba8fe662 Reverting dtor devirtualization patch.
_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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44760 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 02:14:30 +00:00
Gordon Henriksen
ed455c8fa2 Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 22:46:10 +00:00
Chris Lattner
dec628eead Switch ValueSymbolTable to use StringMap<Value*> instead of 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
2007-02-12 05:18:08 +00:00
Chris Lattner
023cfb6871 Move the definition of value_use_iterator::getOperandNo to User.h where the
definition of the User class is available, this fixes the  build with some
compiler versions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28163 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 05:59:36 +00:00
Misha Brukman
9769ab2226 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21408 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 20:19:05 +00:00
Chris Lattner
f8db8a0432 Fix spelling, patch contributed by Gabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20342 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-27 06:15:51 +00:00
Chris Lattner
f718e70c7e Instead of storing operands as std::vector<Use>, just maintain a pointer
and num operands in the User class.  this allows us to embed the operands
directly in the subclasses if possible.  For example, for binary operators
we store the two operands in the derived class.

The has several effects:
  1. it improves locality because the operands and instruction are together
  2. it makes accesses to operands faster (one less load) if you access them
     through the derived class pointer.  For example this:

Value *GetBinaryOperatorOp(BinaryOperator *I, int i) {
  return I->getOperand(i);
}

Was compiled to:

_Z19GetBinaryOperatorOpPN4llvm14BinaryOperatorEi:
        movl    4(%esp), %edx
        movl    8(%esp), %eax
        sall    $4, %eax
        movl    24(%edx), %ecx
        addl    %ecx, %eax
        movl    (%eax), %eax
        ret

and is now compiled to:

_Z19GetBinaryOperatorOpPN4llvm14BinaryOperatorEi:
        movl    8(%esp), %eax
        movl    4(%esp), %edx
        sall    $4, %eax
        addl    %edx, %eax
        movl    44(%eax), %eax
        ret

Accesses through "Instruction*" are unmodified.

   3. This reduces memory consumption (by about 3%) by eliminating 1 word of
      vector overhead and a malloc header on a seperate object.
   4. This speeds up gccas about 10% (both debug and release builds) on
      large things (such as 176.gcc).  For example, it takes a debug build
      from 172.9 -> 155.6s and a release gccas from 67.7 -> 61.8s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19883 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:29:39 +00:00
Chris Lattner
c063502e32 Warning fixes for VC++, contributed by Morten Ofstad!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17831 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 19:02:35 +00:00
Reid Spencer
e3d19aac69 bug 122:
Remove redundancy in User::classof(Value*); GlobalValue isa Constant now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14924 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 23:32:11 +00:00
Chris Lattner
38ab9267c9 Make ctor inline, change ValueTy ->unsigned
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14430 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-27 18:01:15 +00:00
Chris Lattner
0b0863778f Consider anything with a ValueType that is >= Instruction to be an instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14429 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-26 20:51:50 +00:00
Chris Lattner
8b70b78ba4 Fixes for PR114: Thanks to Reid Spencer!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10029 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-16 20:21:15 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
John Criswell
6fbcc26f14 Added LLVM copyright header (for lack of a better term).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9304 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 20:19:47 +00:00
Chris Lattner
978e2cbfb2 lalala
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9146 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-15 22:09:57 +00:00
Chris Lattner
d7db1fb944 Add new op_erase method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9068 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:29:26 +00:00
Chris Lattner
97622b1751 Add a method to reserve space for operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8992 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-09 22:45:59 +00:00
Chris Lattner
b0a994b4c0 Remove unneeded dtors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8896 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-06 17:36:49 +00:00
Chris Lattner
48486893f4 Standardize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8782 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-30 18:37:50 +00:00
Chris Lattner
3889a2cb05 Remove a ton of extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6842 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 03:08:05 +00:00
Chris Lattner
a599f871af Add new op_erase method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6757 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 22:15:55 +00:00
John Criswell
be583b914d Included assert.h so that the code compiles under newer versions of GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6682 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-11 14:01:36 +00:00
Chris Lattner
f0afa50b6c Don't require the user to do something like isa<foo>(II->get()). The ->get
should be implicit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6395 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-29 15:08:33 +00:00
Chris Lattner
1da2972d26 - Remove the User::eraseOperand method which is never used, really
dangerous, and not something we want to expose.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4007 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 23:41:17 +00:00
Vikram S. Adve
e8f1df6446 Add routines to update or erase operands (and to do so without external
assumptions about which operand number stores what operand).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3750 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 16:06:12 +00:00
Chris Lattner
2619905926 Convert comments to Doxygen style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3507 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-25 22:54:55 +00:00
Chris Lattner
dc58535b37 Remove unneccesary method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3452 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 15:57:37 +00:00
Vikram S. Adve
cab1a52aa2 Add method copyOperands().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3445 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 03:01:44 +00:00
Chris Lattner
af2d701e12 Remove a misguided API extension
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1926 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 05:46:43 +00:00
Chris Lattner
697954c15d Changes to build successfully with GCC 3.02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-20 22:54:45 +00:00
Chris Lattner
7a17675206 Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1408 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-04 00:03:30 +00:00
Chris Lattner
26e129e64f Add classof implementations for User
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@739 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-13 06:18:05 +00:00
Chris Lattner
46cbff625e Chris seems fond of #include <vector>. Fix these. Also convert use list in
Value to a vector instead of a list.

Move SchedGraph.h & SchedPriorities.h into lib/CodeGen/InstrScheduling


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@572 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-14 16:56:32 +00:00
Chris Lattner
d964e56a92 Remove extra whitespace at EOL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@427 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-07 16:24:35 +00:00
Chris Lattner
fb3f24fd57 Fix stupid typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-09 16:54:29 +00:00
Chris Lattner
cbab0f7edd Add a new "addOperand" method to User.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-08 18:38:18 +00:00
Chris Lattner
30f24a402c Devirtualize User::dropAllReferences
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-07 19:00:36 +00:00
Chris Lattner
c8b25d40cb Changed the fundemental architecture of Operands for Instructions. Now
Operands are maintained as a vector<Use> in the User class, and operator
iterators are provided as before.  Getting an operand no longer requires
a virtual function call.

WARNING: getOperand(x) where x >= getNumOperands() will now assert instead
of returning null!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-07 08:36:50 +00:00
Chris Lattner
009505452b Initial revision
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-06 20:29:01 +00:00