Commit Graph

2973 Commits

Author SHA1 Message Date
Jeff Cohen
23a1cf3e08 Change __MINGW to __MINGW32__. Patch submitted by Henrik Bach.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20243 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-19 03:01:13 +00:00
Chris Lattner
b29cb29364 Map doubles from integers, not the double itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20229 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-17 20:16:58 +00:00
Chris Lattner
d672ab936f Add a new method to make it easy to update graphs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20194 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-15 18:40:55 +00:00
Chris Lattner
0c09e5fb91 Move private helper function into the only .cpp file that uses it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20169 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 23:14:06 +00:00
Chris Lattner
8a1573f823 Do not replace ostream << Module*, only ostream << Module&.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20157 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 19:15:01 +00:00
Chris Lattner
afc0dc7184 Add a new replaceSymbolicValuesWithConcrete method to the SCEV class,
adjust const'ness a bit to be more correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20145 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 04:34:51 +00:00
Chris Lattner
748ca4de2c Add some iterators that should have come in long ago
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20085 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-09 03:14:29 +00:00
Chris Lattner
ddf5a35eed Hopefully fix the build on Darwin with GCC 3.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20064 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 16:09:01 +00:00
Chris Lattner
eecfea4da6 Eliminate the explicit opcode field in ConstantExpr, using the SubclassData
field to hold it instead.  This shrinks memory usage for 176.gcc from
57628728 to 57598144 bytes, a small reduction of about 30K.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20047 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 02:00:12 +00:00
Chris Lattner
88fe29a1da Eliminate the explicit volatile fields in LoadInst and StoreInst. This shrinks
LoadInst from 60 -> 56 bytes and StoreInst from 76 -> 72 bytes.

Note however, that this doesn't actually save any memory on common systems
where 'malloc' returns 8-byte aligned memory, as the saved space is replaced
by useless alignment padding.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20046 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 01:44:18 +00:00
Chris Lattner
8f0d403926 SubclassID is really a small field. Split it into half and let subclasses
play with the unused part.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20043 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 01:37:44 +00:00
Chris Lattner
eefc71be20 Add some new members
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20034 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 19:58:06 +00:00
Chris Lattner
fbafcb7468 add new member
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20033 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 19:57:57 +00:00
Chris Lattner
3a826203c7 Add a new method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20017 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-03 18:40:05 +00:00
Chris Lattner
321f68306f remove dead method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19977 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 21:37:06 +00:00
Chris Lattner
a266197489 Switch from using an ilist for uses to using a custom doubly linked list.
This list does not provide the ability to go backwards in the list (its
more of an unordered collection, stored in the shape of a list).

This change means that use iterators are now only forward iterators, not
bidirectional.

This improves the memory usage of use lists from '5 + 4*#use' per value to
'1 + 4*#use'.  While it would be better to reduce the multiplied factor,
I'm not smart enough to do so.  This list also has slightly more efficient
operators for manipulating list nodes (a few less loads/stores), due to not
needing to be able to iterate backwards through the list.

This change reduces the memory footprint required to hold 176.gcc from
66.025M -> 57.687M, a 14% reduction.  It also speeds up the compiler,
7.73% in the case of bytecode loading alone (release build loading 176.gcc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19956 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 01:22:06 +00:00
Chris Lattner
a9548d9fd9 * Make some methods more const correct.
* Change the FunctionCalls and AuxFunctionCalls vectors into std::lists.
  This makes many operations on these lists much more natural, and avoids
  *exteremely* expensive copying of DSCallSites (e.g. moving nodes around
  between lists, erasing a node from not the end of the vector, etc).

With a profile build of analyze, this speeds up BU DS from 25.14s to
12.59s on 176.gcc.  I expect that it would help TD even more, but I don't
have data for it.

This effectively eliminates removeIdenticalCalls and children from the
profile, going from 6.53 to 0.27s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19939 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 23:51:02 +00:00
Chris Lattner
bbec41dbac Improve spelling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19931 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 00:13:34 +00:00
Chris Lattner
bca81448ac Improve conformance with the Misha spelling benchmark suite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19930 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 00:09:23 +00:00
Chris Lattner
02accaeb17 Adjust to ilist changes.
Based on the ilist changes avoid allocating an entire Use object for the
end of the Use chain.  This saves 8 bytes of memory for each Value allocated
in the program.  For 176.gcc, this reduces us from 69.5M -> 66.0M, a 5.3%
memory savings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19925 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 18:43:28 +00:00
Chris Lattner
3cf8e6857e Adjust to ilist changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19923 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 18:41:12 +00:00
Chris Lattner
38653f0ac8 Adjust to changes in ilist
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19922 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 18:41:00 +00:00
Chris Lattner
ed4d467c69 Rename createNode -> createSentinal.
Add a new method, destroySentinal, that is used to delete it (instead of
requiring use of delete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19921 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 18:40:19 +00:00
Chris Lattner
74a77cd985 There is no reason to include ostream here, include iosfwd instead.
This file was schizophrenic when it came to representing sizes.  In some
cases it represented them as 'unsigneds', which are not enough for 64-bit
hosts.  In other cases, it represented them as uint64_t's, which are
inefficient for 32-bit hosts.

This patch unifies all of the sizes to use size_t instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19917 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 17:16:07 +00:00
Chris Lattner
8b80ecd5ca Fix quotes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19909 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:29:45 +00:00
Jeff Cohen
2cc2ab96e0 Unbreak VC++ build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19908 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:27:16 +00:00
Chris Lattner
6cfbd62680 Memory used is a delta between memuse at the start of the time and the
memuse at the end, thus it is signed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19904 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 05:21:16 +00:00
Chris Lattner
5181ac8081 Adjust to changes in the User class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19888 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:33:00 +00:00
Chris Lattner
ec285706ae Adjust to changes in the User class. Introduce a new UnaryInstruction
class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19887 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:32:51 +00:00
Chris Lattner
519ccafc18 Adjust to user changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19886 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:32:00 +00:00
Chris Lattner
454928eda4 Many changes to cope with the User.h changes. Instructions now generally
directly embed their operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19885 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:31:36 +00:00
Chris Lattner
b8d5b1211f Adjust to User.h changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19884 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:30:52 +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
e6585ab601 Do not clean up if the MappedFile was never used or if the client already
closed the file.  This unbreaks the build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19871 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 16:08:23 +00:00
Jeff Cohen
a5ba89421e Get VC++ compiling again
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19869 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 07:29:32 +00:00
Reid Spencer
be4922a28a Convert some old C-style casts to C++ style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19868 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 07:22:20 +00:00
Chris Lattner
d5af7c4df6 Add some methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19817 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 19:55:34 +00:00
Misha Brukman
bcb18fa612 primitive' has no a'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19808 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 16:28:03 +00:00
Chris Lattner
49266b2afa Do not return true from isSized for things without a size (like functions and
labels) even though they are concrete.  This fixes the DSA regressions from
last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19807 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 16:00:52 +00:00
Chris Lattner
d23a298f28 This giant patch speeds up Type::isSized(). Before, this would have to search
large nested types over and over again to determine if they are sized or not.
Now, isSized() is able to make snap decisions about all concrete types, which
are a common occurance (and includes all primitives).

On 177.mesa, this speeds up DSE from 39.5s -> 21.3s and GCSE from
13.2s -> 11.3s, reducing gccas time from 80s -> 61s (this is a debug build).

DSE and GCSE are still too slow on this testcase, but this is a simple
improvement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19800 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 02:08:34 +00:00
Chris Lattner
471f09090d Add an accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19794 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 22:57:27 +00:00
Chris Lattner
d6b210ca38 Expose more information from register allocation to passes that run after
it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19788 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 22:13:36 +00:00
Chris Lattner
063287a76b Give SelectionDAG a TargetLowering instance instead of TM instance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19778 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 04:36:06 +00:00
Chris Lattner
f61c001673 Remove two dead methods and improve the comments for DiffFilesWithTolerance.
Also, make DiffFilesWithTolerance take sys::Path objects instead of std::strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19770 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 03:30:39 +00:00
Chris Lattner
fc54a35956 New method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19765 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 03:11:38 +00:00
Jeff Cohen
83881957ed Fix VC++ complaint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19747 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 16:30:58 +00:00
Chris Lattner
0442fbfadb Keep track of node depth for each node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19732 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 21:39:38 +00:00
Chris Lattner
fb01550ace Apparently destroyFile() now throws an exception. Since this class is
designed to be put on the stack, that's not cool.  Catch and ignore the
exception.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19723 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-20 23:31:35 +00:00
Chris Lattner
5880b9fa3e Eliminate the unimplemented ADDC/SUBB operations, add ADD_PARTS/SUB_PARTS instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19713 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-20 18:50:39 +00:00
Chris Lattner
02b86f52ed Add an accessor for targets that pass args in regs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19702 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 20:19:58 +00:00