Commit Graph

3034 Commits

Author SHA1 Message Date
Chris Lattner
6269be8aca Make each scalar map contain a reference to an equivalence class of global
variables.  Do not insert a global into the scalar map unless it is the
leader of its equivalence class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20695 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 22:13:13 +00:00
Chris Lattner
ed53fe9945 Each DS collection now contains an equivalence class of globals values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20694 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 22:12:33 +00:00
Chris Lattner
ce325fdb87 add a method to clear globals from a node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20693 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 22:12:03 +00:00
Chris Lattner
1f377fefb7 Two fixes for the copy ctor/operator=:
1. Make sure to clear() 'this' before adding elements to it
  2. Make sure that the leaders of the RHS EC are the leaders of the LHS EC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20692 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 21:02:12 +00:00
Chris Lattner
6782397046 add some methods, fix a major bug in getLeader() that was causing things to
not be unified correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20691 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 20:42:43 +00:00
Chris Lattner
4a6d9cf122 implement a proper copy ctor, operator= and add a helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20690 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 19:26:14 +00:00
Alkis Evlogimenos
1cecd3a1d2 Add new function getPtrPtrFromArrayPtr().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20684 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 11:40:31 +00:00
Chris Lattner
72af57f26c Rewrite this class, making the following improvements:
1. It now actually uses tarjan's algorithm, so it is a efficient inverse
     ackerman's function for union operations, not linear time.
  2. It now stores one copy of the data in the set instead of two.
  3. It now works for elements other than pointers.
  4. It now has a more STL-like interface that exposes iterators instead
     of internal implementation details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20677 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 05:14:29 +00:00
Chris Lattner
0f34412293 add 3 methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20667 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 23:45:35 +00:00
Duraid Madina
aff20c03fb dainty
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20653 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 18:23:22 +00:00
Chris Lattner
986d99a6f8 remove compat_iterator, which is dead in the tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20644 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-16 22:42:45 +00:00
Chris Lattner
df6001380a remove use of compat_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20642 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-16 22:42:01 +00:00
Jeff Cohen
4d1b4458fe Don't provide default hash struct instantiation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20639 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-16 05:49:06 +00:00
Jeff Cohen
1467e7ae92 Add adapter class to let VC++ hash_map use GCC's hash struct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20637 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-16 05:25:09 +00:00
Misha Brukman
fb215b936d Fix grammar wrt apostrophe's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20635 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-16 03:54:50 +00:00
Misha Brukman
9110286da1 Convert tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20634 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-16 03:46:55 +00:00
Chris Lattner
a9fec4ed81 remove warning, make computeGGToGMapping return an invnodemap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20621 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 17:52:07 +00:00
Chris Lattner
adea6306d4 add support for hashing nodehandles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20620 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 17:51:51 +00:00
Chris Lattner
60cc3e1c4e add iterators for return nodes list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20617 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 16:46:11 +00:00
Jeff Cohen
805213e65c Do it right...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20605 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 06:21:40 +00:00
Jeff Cohen
0ef161eef9 Fix VC++ breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20604 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 06:15:08 +00:00
Chris Lattner
4d24a5d450 remove reverse BB iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20601 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 05:17:48 +00:00
Chris Lattner
6ca71751af remove a whole bunch of dead methods. Noone should use reverse iterators anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20600 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 05:13:47 +00:00
Chris Lattner
e448580492 Rename method, add counterpart.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20592 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 00:58:09 +00:00
Chris Lattner
2427c9dfb3 Remove the reverse iterators for arguments and global vars.
Rename argument iterators arg_* instead of a*
Remove global variable iterators global_* instead of g*.

Keep the old names for temporary compatibility.

Patch contributed by Gabor Greif!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20591 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-14 23:49:40 +00:00
Chris Lattner
62b2b22573 Add a useful method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20587 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-14 19:22:33 +00:00
Chris Lattner
bc341e616e Add support for printing EQ graphs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20581 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-13 19:50:40 +00:00
Chris Lattner
977df76722 add a helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20578 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-13 19:04:04 +00:00
Chris Lattner
b25959a632 remove this from the PA namespace, leaving it in the llvm ns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20574 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-12 12:08:52 +00:00
Chris Lattner
8694c076c7 Fix some crashes noted by John Mellor-Crummey's group.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20558 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-11 00:00:56 +00:00
Chris Lattner
f768bba43f Allow the live interval analysis pass to be a bit more aggressive about
numbering values in live ranges for physical registers.

The alpha backend currently generates code that looks like this:

  vreg = preg
...
  preg = vreg
  use preg
...
  preg = vreg
  use preg

etc.  Because vreg contains the value of preg coming in, each of the
copies back into preg contain that initial value as well.

In the case of the Alpha, this allows this testcase:

void "foo"(int %blah) {
        store int 5, int *%MyVar
        store int 12, int* %MyVar2
        ret void
}

to compile to:

foo:
        ldgp $29, 0($27)
        ldiq $0,5
        stl $0,MyVar
        ldiq $0,12
        stl $0,MyVar2
        ret $31,($26),1

instead of:

foo:
        ldgp $29, 0($27)
        bis $29,$29,$0
        ldiq $1,5
        bis $0,$0,$29
        stl $1,MyVar
        ldiq $1,12
        bis $0,$0,$29
        stl $1,MyVar2
        ret $31,($26),1

This does not seem to have any noticable effect on X86 code.

This fixes PR535.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20536 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-09 23:05:19 +00:00
Chris Lattner
fc4addafb5 Use static_cast and #include Instructions.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20528 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-09 05:35:16 +00:00
Chris Lattner
df28a31435 export two methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20526 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-09 05:34:23 +00:00
Chris Lattner
82870e0b73 Fix problems compiling with G++ 4.x.x with -pedantic. Thanks to
Vladimir Merzliakov for the patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20513 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-07 20:35:45 +00:00
Chris Lattner
51a4ad475b new helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20491 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 20:55:34 +00:00
Chris Lattner
bf4515e218 move some method declarations around to make it clear that users should
not call insert(Value *Val), remove(Value* Val), or
changeName(Value *V, const std::string &Name)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20488 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 06:03:44 +00:00
Chris Lattner
c0d369d879 this method is never called.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20487 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 06:00:24 +00:00
Chris Lattner
73091bcebe the only caller of insertEntry is insert, inline it and remove insertEntry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20485 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 05:56:02 +00:00
Chris Lattner
58b004c2a3 remove this method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20482 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 05:50:49 +00:00
Chris Lattner
1327c5ab99 Delete the really inefficient method: void remove(const Type* Typ);
Get rid of removeEntry(type_iterator), since 'remove' is exactly the same
operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20480 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 05:46:00 +00:00
Chris Lattner
c9a33cefb8 InternallyInconsistent is dead!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20478 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 05:22:05 +00:00
Chris Lattner
84ceb33f92 remove these dead methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20475 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 02:38:24 +00:00
Chris Lattner
ea8186ad62 nuke some dead methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20470 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 02:25:02 +00:00
Chris Lattner
eaadf58276 Add a new method, allow symtab to poke name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20468 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 02:10:40 +00:00
Chris Lattner
d81b691ea0 remove extraneous spaces from argument lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20465 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-05 19:58:40 +00:00
Chris Lattner
0d1e40728d remove all of the various setName implementations, consolidating them into
Value::setName, which is no longer virtual.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20464 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-05 19:51:50 +00:00
Chris Lattner
d0478744b3 Remove the second argument to Value::setName, it is never needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20457 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-05 18:59:36 +00:00
Jeff Cohen
2f3c9b7562 Add support for not strength reducing GEPs where the element size is a small
power of two.  This emphatically includes the zeroeth power of two.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20429 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-04 04:04:26 +00:00
Chris Lattner
7dd732bf80 Add an argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20413 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-03 01:03:10 +00:00
Chris Lattner
e4666594d0 Now that type does not derive from Value, these do not need to be virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20393 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-02 03:43:55 +00:00