Commit Graph

2960 Commits

Author SHA1 Message Date
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
Chris Lattner
d7e2fe40e4 Add a new method, described in the comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19683 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 06:53:02 +00:00
Jeff Cohen
8e1971bda2 Add missing data types for VC++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19680 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 05:08:31 +00:00
Chris Lattner
6147a7aa17 Move all data members to the end of the class.
Add a hook to find out how the target handles shift amounts that are out of
range.  Either they are undefined (the default), they mask the shift amount
to the size of the register (X86, Alpha, etc), or they extend the shift (PPC).

This defaults to undefined, which is conservatively correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19676 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 03:36:03 +00:00
Chris Lattner
c7ba0eb5eb Keep track of the returned value type as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19669 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 19:26:18 +00:00
Chris Lattner
30c0fc23c5 Allow setcc operations to have non-bool types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19655 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 02:51:41 +00:00
Chris Lattner
80d8a93489 Make methods private, add a method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19634 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 17:14:43 +00:00
Chris Lattner
7ece380440 Add methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19627 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 02:24:59 +00:00
Chris Lattner
6ae76fcc06 Add comments
Add fields to hold the result type of setcc operations and shift amounts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19618 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 23:59:30 +00:00
Chris Lattner
7e5ee40979 Revamp supported ops. Instead of just being supported or not, we now keep
track of how to deal with it, and provide the target with a hook that they
can use to legalize arbitrary operations in arbitrary ways.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19609 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 07:27:49 +00:00
Reid Spencer
8085cff7eb Provide support for HP/UX aCC compiler's variant of hash_map and hash_set
(RogueWave). These are implemented in rw/stdex/hash_map.h and
rw/stdex/hash_set.h on HP/UX.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19600 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 02:58:39 +00:00
Chris Lattner
638559aaa3 Improve compatiblity with HPUX on Itanium, patch by Duraid Madina
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19586 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 01:31:31 +00:00
Chris Lattner
3eb223eaf7 Improve compatibility with aCC on HPUX. Patch by Duraid Madina
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19585 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 01:22:18 +00:00
Chris Lattner
bb97d81cc8 Move some information out of LegalizeDAG into the generic Target interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19581 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 01:10:58 +00:00