Commit Graph

2798 Commits

Author SHA1 Message Date
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
Evan Cheng
c384d6c398 - Change AssignTopologicalOrder to return vector of SDNode* by reference.
- Tweak implementation to avoid using std::map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29479 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-02 22:00:34 +00:00
Jim Laskey
eb577ba3b8 Final polish on machine pass registries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29471 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-02 12:30:23 +00:00
Jim Laskey
9373beba60 Now that the ISel is available, it's possible to create a default instruction
scheduler creator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29452 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-01 19:14:14 +00:00
Jim Laskey
9ff542f2cc 1. Change use of "Cache" to "Default".
2. Added argument to instruction scheduler creators so the creators can do
special things.
3. Repaired target hazard code.
4. Misc.

More to follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29450 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-01 18:29:48 +00:00
Jim Laskey
c6a0a117a6 Forgot the added files for plugable machine passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29436 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-01 16:31:08 +00:00
Jim Laskey
13ec702c43 Introducing plugable register allocators and instruction schedulers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29434 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-01 14:21:23 +00:00
Evan Cheng
e6f35d8a5c Added AssignTopologicalOrder() to assign each node an unique id based on their topological order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29431 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-01 08:20:41 +00:00
Evan Cheng
8825a485e2 PIC jump table entries are always 32-bit even in 64-bit mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29422 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-01 01:03:13 +00:00
Chris Lattner
4a6bd33da0 Instead of blindly looking past constantexpr casts, actually constant
fold them.  This correctly truncates constants that are too large for the
destination slot and makes the code easier to understand.  This fixes PR853
and Regression/CodeGen/X86/2006-07-28-AsmPrint-Long-As-Pointer.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29408 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-29 01:57:19 +00:00
Evan Cheng
2641cad180 Remove InFlightSet hack. No longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29373 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-28 00:47:19 +00:00