Commit Graph

2808 Commits

Author SHA1 Message Date
Chris Lattner
7f8897f22e eliminate RegisterOpt. It does the same thing as RegisterPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 22:42:52 +00:00
Chris Lattner
5d8925c7c5 Eliminate RegisterAnalysis. RegisterPass now does all that is necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29921 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 22:30:17 +00:00
Chris Lattner
a4f0b3a084 s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 12:54:02 +00:00
Chris Lattner
c9d94d1290 typo fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29910 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 12:47:48 +00:00
Evan Cheng
694481ee01 Eliminate SelectNodeTo() and getTargetNode() variants which take more than
3 SDOperand operands. They are replaced by versions which take an array
of SDOperand and the number of operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29905 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 08:08:54 +00:00
Nate Begeman
d2030e6c99 Properly size the string table, and emit symbol table and string table
entries in the correct order, fixing several fixmes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29902 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-26 15:46:34 +00:00
Evan Cheng
95514bae73 SelectNodeTo now returns a SDNode*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29901 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-26 08:00:10 +00:00
Chris Lattner
e7f729b42b Simplifications to liveinterval analysis, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29896 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-26 01:28:16 +00:00
Chris Lattner
c114b2cad7 Completely change the way that joining with physregs is implemented. This
paves the way for future changes, increases coallescing opportunities (in
theory, not witnessed in practice), and eliminates the really expensive
LiveIntervals::overlapsAliases method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29890 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 23:41:24 +00:00
Jim Laskey
08ede262a7 Tidy up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29888 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 22:56:30 +00:00
Jim Laskey
f3e4f0e615 Consolidate callee saved register information so that it can me used by debug
information and exception handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29881 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 19:45:51 +00:00
Jim Laskey
3d3d404b8a Allow for register numbers > 31.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29879 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 19:39:52 +00:00
Nate Begeman
f8f2c5a172 Get closer to handling globals correctly. We now generally get them in the
right section.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29871 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 06:36:58 +00:00
Chris Lattner
c82b3aab65 When replacing value numbers, make sure to compactify the value # space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29865 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-24 23:22:59 +00:00
Chris Lattner
f7da2c7b0c Take advantage of the recent improvements to the liveintervals set (tracking
instructions which define each value#) to simplify and improve the coallescer.
In particular, this patch:

1. Implements iterative coallescing.
2. Reverts an unsafe hack from handlePhysRegDef, superceeding it with a
   better solution.
3. Implements PR865, "coallescing" away the second copy in code like:

   A = B
   ...
   B = A

This also includes changes to symbolically print registers in intervals
when possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29862 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-24 22:43:55 +00:00
Nate Begeman
eb883af390 Initial checkin of the Mach-O emitter. There's plenty of fixmes, but it
does emit linkable .o files in very simple cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29850 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-23 21:08:52 +00:00
Chris Lattner
be4f88a8b8 Improve the LiveInterval class to keep track of which machine instruction
defines each value# tracked by the interval.  This will be used to improve
coallescing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29830 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-22 18:19:46 +00:00
Chris Lattner
8222b2de22 Print physreg names symbolically in dumps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29805 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-21 23:03:54 +00:00
Chris Lattner
7c10b0d2c9 Print debug info as:
*** Register mapping ***
  reg 1024 -> %reg1028
  reg 1026 -> EAX
  reg 1027 -> %reg1028

instead of:

*** Register mapping ***
  reg 1024 -> reg 1028
  reg 1026 -> reg 15
  reg 1027 -> reg 1028


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29803 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-21 22:56:29 +00:00
Jim Laskey
760383e298 Adding C++ member support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29799 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-21 21:20:18 +00:00
Chris Lattner
f921a51891 Fix PR861
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29796 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-21 20:24:53 +00:00
Bill Wendling
d36d03bf2d Added a check so that if we have two machine instructions in this form
MOV R0, R1
    MOV R1, R0

the second machine instruction is removed. Added a regression test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29792 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-21 07:33:33 +00:00
Chris Lattner
228a18e0f2 switch the SUnit pred/succ sets from being std::sets to being smallvectors.
This reduces selectiondag time on kc++ from 5.43s to 4.98s (9%).  More
significantly, this speeds up the default ppc scheduler from ~1571ms to 1063ms,
a 33% speedup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29743 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-17 00:09:56 +00:00
Chris Lattner
be384162c6 minor changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29740 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-16 22:57:46 +00:00
Chris Lattner
f83482dcad Use the appropriate typedef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29730 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-16 20:59:32 +00:00
Chris Lattner
0b3e525a3a Start using SDVTList more consistently
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29711 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-15 19:11:05 +00:00
Chris Lattner
70046e920f add a new SDVTList type and new SelectionDAG::getVTList methods to streamline
the creation of canonical VTLists.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29709 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-15 17:46:01 +00:00
Chris Lattner
f9f37fc52c eliminate use of getNode that takes vector of valuetypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29687 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-14 23:53:35 +00:00
Chris Lattner
2fa6d3b1fc Add a new getNode() method that takes a pointer to an already-intern'd list
of value-type nodes.  This avoids having to do mallocs for std::vectors of
valuetypes when a node returns more than one type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29685 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-14 23:31:51 +00:00
Chris Lattner
e51ee04c3d remove SelectionDAG::InsertISelMapEntry, it is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29677 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-14 22:24:39 +00:00
Chris Lattner
213a16c637 Add code to resize the CSEMap hash table. This doesn't speedup codegen of
kimwitu, but seems like a good idea from a "avoid performance cliffs" standpoint :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29675 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-14 22:19:25 +00:00
Chris Lattner
130fc13506 Add the actual constant to the hash for ConstantPool nodes. Thanks to
Rafael Espindola for pointing this out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29669 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-14 20:12:44 +00:00
Nate Begeman
52a51e38dc Emit .set directives for jump table entries when possible, which reduces
the number of relocations in object files, shrinkifying them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29650 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-12 21:29:52 +00:00
Chris Lattner
103de7785a Fix an obvious bug, noticed by inspection. No current targets trigger this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29648 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-12 05:41:39 +00:00
Chris Lattner
dd28900168 Switch to using SuperFastHash instead of adding all elements together. This
doesn't significantly improve performance but it helps a small amount.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29642 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-12 01:07:10 +00:00
Chris Lattner
7ed9ea81f8 Switch NodeID to track 32-bit chunks instead of 8-bit chunks, for a 2.5%
speedup in isel time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29640 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-11 23:55:53 +00:00
Chris Lattner
c9f8f41680 Remove 8 more std::map's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29631 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-11 21:55:30 +00:00
Chris Lattner
61b09412fe Move the BBNodes, GlobalValues, TargetGlobalValues, Constants, TargetConstants,
RegNodes, and ValueNodes maps into the CSEMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29626 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-11 21:01:22 +00:00
Chris Lattner
4a283e90af eliminate the NullaryOps map, use CSEMap instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29621 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-11 18:38:11 +00:00
Chris Lattner
3577e38c2b change internal impl of dag combiner so that calls to CombineTo never have to
make a temporary vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29618 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-11 17:56:38 +00:00
Chris Lattner
b9ea4a39b8 Change one ReplaceAllUsesWith method to take an array of operands to replace
instead of a vector of operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29616 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-11 17:46:28 +00:00
Chris Lattner
bd564bfc63 Start eliminating temporary vectors used to create DAG nodes. Instead, pass
in the start of an array and a count of operands where applicable.  In many
cases, the number of operands is known, so this static array can be allocated
on the stack, avoiding the heap.  In many other cases, a SmallVector can be
used, which has the same benefit in the common cases.

I updated a lot of code calling getNode that takes a vector, but ran out of
time.  The rest of the code should be updated, and these methods should be
removed.

We should also do the same thing to eliminate the methods that take a
vector of MVT::ValueTypes.

It would be extra nice to convert the dagiselemitter to avoid creating vectors
for operands when calling getTargetNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29566 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-08 02:23:42 +00:00
Chris Lattner
f06f35e30b Eliminate some malloc traffic by allocating vectors on the stack. Change some
method that took std::vector<SDOperand> to take a pointer to a first operand
and #operands.

This speeds up isel on kc++ by about 3%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29561 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-08 01:09:31 +00:00
Chris Lattner
a5682853b9 Revamp the "CSEMap" datastructure used in the SelectionDAG class. This
eliminates a bunch of std::map's in the SelectionDAG, replacing them with a
home-grown hashtable.

This is still a work in progress: not all the maps have been moved over and the
hashtable never resizes.  That said, this still speeds up llc 20% on kimwitu++
with -fast -regalloc=local using a release build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29550 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-07 23:03:03 +00:00
Evan Cheng
99157a00a6 Clear TopOrder before assigning topological order. Some clean ups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29546 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-07 22:13:29 +00:00
Evan Cheng
3b97acdbdb Reverse the FlaggedNodes after scanning up for flagged preds or else the order would be reversed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29545 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-07 22:12:12 +00:00
Chris Lattner
190a418bf6 Make SelectionDAG::RemoveDeadNodes iterative instead of recursive, which
also make it simpler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29524 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-04 17:45:20 +00:00
Jim Laskey
f492391de0 Copy the liveins for the first block. PR859
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29511 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-03 20:51:06 +00:00
Chris Lattner
3700f90c19 Work around a GCC 3.3.5 bug noticed by a user.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29490 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-03 00:18:59 +00:00
Chris Lattner
8653b37ab9 Work around a bug in gcc 3.3.5, reported by a user
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29489 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-03 00:16:56 +00:00