Commit Graph

879 Commits

Author SHA1 Message Date
Chris Lattner 1dfa97034d Allow for fixed objects to reside in the local area, and if they don't to not
clobber them by allocating other objects in the same space!

llvm-svn: 11454
2004-02-15 00:14:20 +00:00
Alkis Evlogimenos 6a35516dcc Add back machine code deleter pass until we get a MachineCode pass
that will be responsible for the creation of MachineFunctions and will
be required by all MachineFunctionPass passes.

llvm-svn: 11453
2004-02-15 00:03:15 +00:00
Chris Lattner 612ce0c47c There is no reason to align the stack pointer if there are no callees of this function!
llvm-svn: 11449
2004-02-14 20:10:59 +00:00
Alkis Evlogimenos 5a92240270 Use newly added next() and prior() utility functions.
llvm-svn: 11430
2004-02-14 01:18:34 +00:00
Alkis Evlogimenos ddcb4ad53e Use std::numeric_limits<float>::infinity() instead of
std::numeric_limits<float>::max() for weighting preallocated
intervals.

llvm-svn: 11427
2004-02-14 00:44:07 +00:00
Alkis Evlogimenos 8cdd0215bf Remove getAllocatedRegNum(). Use getReg() instead.
llvm-svn: 11393
2004-02-13 21:01:20 +00:00
Alkis Evlogimenos de6a381691 Use getNumVirtualRegs().
Whitespace cleanups.

llvm-svn: 11389
2004-02-13 18:20:47 +00:00
Brian Gaeke 52440fd481 Refactor MachineFunction::print() into MachineBasicBlock::print().
Add MachineBasicBlock::dump().

llvm-svn: 11364
2004-02-13 04:39:55 +00:00
Brian Gaeke e8f7c2f863 Add head-of-file comments and Doxygen comments. Tighten up a lot of whitespace.
Rename SetMachineOperandConst's formal parameters to match other methods here.
Mark some methods as being used only by the SPARC back-end.
Fix a missing-paren bug in OutputValue().

llvm-svn: 11363
2004-02-13 04:39:32 +00:00
Alkis Evlogimenos de8ac749fe Add parent pointer to MachineInstr that points to owning
MachineBasicBlock. Also change opcode to a short and numImplicitRefs
to an unsigned char so that overall MachineInstr's size stays the
same.

llvm-svn: 11357
2004-02-12 18:49:07 +00:00
Chris Lattner 6a597d6057 Rename the opCode instance variable to Opcode
llvm-svn: 11348
2004-02-12 16:09:53 +00:00
Chris Lattner 6108d9d5ee This field is never read
llvm-svn: 11346
2004-02-12 16:04:49 +00:00
Alkis Evlogimenos 80da865f77 Change MachineBasicBlock's vector of MachineInstr pointers into an
ilist of MachineInstr objects. This allows constant time removal and
insertion of MachineInstr instances from anywhere in each
MachineBasicBlock. It also allows for constant time splicing of
MachineInstrs into or out of MachineBasicBlocks.

llvm-svn: 11340
2004-02-12 02:27:10 +00:00
Brian Gaeke 0c3de446f6 getOpCode() --> getOpcode().
llvm-svn: 11339
2004-02-12 01:34:05 +00:00
Chris Lattner b21ec54e61 Add #include
llvm-svn: 11285
2004-02-10 21:18:55 +00:00
Chris Lattner 5dd5be3ec3 Do not use MachineOperand::isVirtualRegister either!
llvm-svn: 11283
2004-02-10 21:12:22 +00:00
Chris Lattner 373fba5c1d Eliminate users of MachineOperand::isPhysicalRegister
llvm-svn: 11278
2004-02-10 20:41:10 +00:00
Brian Gaeke 2e1cbb735d Move InstrSchedule's iterator begin/end methods inline.
llvm-svn: 11239
2004-02-09 18:42:46 +00:00
Brian Gaeke 312e3a28d2 Make SchedGraph::dump() use SchedGraphNodeCommon's const_iterator
instead of randomly groping about inside its outEdges array.
Make SchedGraph::addDummyEdges() use getNumOutEdges() instead of
outEdges.size().
Get rid of ifdefed-out code in SchedGraph::buildGraph().

llvm-svn: 11238
2004-02-09 18:42:05 +00:00
Chris Lattner 80cbed4f61 Another nice speedup for the register allocator. This time, we replace
the Virt2PhysRegMap std::map with an std::vector.  This speeds up the
register allocator another (almost) 40%, from .72->.45s in a release build
of LLC on 253.perlbmk.

llvm-svn: 11219
2004-02-09 02:12:04 +00:00
Chris Lattner bbd9a43d20 Ugh, perform an optimization that GCC should be able to do itself. This
speeds up livevar from .48/.32s -> .45/.31s in LLC on perlbmk

llvm-svn: 11217
2004-02-09 01:43:23 +00:00
Chris Lattner 26407384ec Only do stuff for the REAL number of physical registers we have, not 1024.
This speeds up live variables a lot, from .60/.39s -> .47/.26s in LLC, for
the first/second pass respectively.

llvm-svn: 11216
2004-02-09 01:35:21 +00:00
Chris Lattner 490627a404 Change the PhysRegsUsed map into a dense array. Seeing that this is a mapping
from physical registers, and they are always dense, it makes sense to not have
a ton of RBtree overhead.  This change speeds up regalloclocal about ~30% on
253.perlbmk, from .35s -> .27s in the JIT (in LLC, it goes from .74 -> .55).

Now live variable analysis is the slowest codegen pass.  Of course it doesn't
help that we have to run it twice, because regalloclocal doesn't update it,
but even if it did it would be the slowest pass (now it's just the 2x slowest
pass :(

llvm-svn: 11215
2004-02-09 01:26:13 +00:00
Alkis Evlogimenos e82a70766e Increase code clarity.
llvm-svn: 11151
2004-02-06 18:08:18 +00:00
Alkis Evlogimenos cd2e7ffcc6 Eliminate uneeded lookups by passing a Virt2PhysMap::iterator instead
of the virtual register to certain functions.

llvm-svn: 11143
2004-02-06 03:15:40 +00:00
Alkis Evlogimenos a97abeb342 Change live interval representation. Machine instructions now have two
slots each. As a concequence they get numbered as 0, 2, 4 and so
on. The first slot is used for operand uses and the second for
defs. Here's an example:

0: A = ...
2: B = ...
4: C = A + B ;; last use of A

The live intervals should look like:

A = [1, 5)
B = [3, x)
C = [5, y)

llvm-svn: 11141
2004-02-05 22:55:25 +00:00
Alkis Evlogimenos 1165c1081e We don't need to scan the blocks that we are live-in on every
access. Rather we only have to do it on the creation of the interval.

llvm-svn: 11135
2004-02-05 20:45:40 +00:00
Tanya Lattner dd0c255d14 Added missing include.
llvm-svn: 11129
2004-02-05 05:04:39 +00:00
Alkis Evlogimenos 327426411e Modify the two address instruction pass to remove the duplicate
operand of the instruction and thus simplify the register allocation.

llvm-svn: 11124
2004-02-04 22:17:40 +00:00
Alkis Evlogimenos 3d100ef0ca When an instruction like: A += B had both A and B virtual registers
spilled, A was loaded from its stack location twice. This fixes the bug.

llvm-svn: 11093
2004-02-03 01:13:07 +00:00
Alkis Evlogimenos 74b26f77a3 Revert changes. Will implement this using a different set of primitives
llvm-svn: 11091
2004-02-02 23:08:58 +00:00
Alkis Evlogimenos 6e34205653 Fix debugging output.
llvm-svn: 11088
2004-02-02 22:00:32 +00:00
Alkis Evlogimenos 6471e66fbb Correctly update def/use information for modified machine operands.
llvm-svn: 11087
2004-02-02 21:56:40 +00:00
Alkis Evlogimenos 86ff30deab Should be more careful. The previously applied change made all counts
outside of loops = 0.

llvm-svn: 11085
2004-02-02 20:29:57 +00:00
Alkis Evlogimenos 2cecace9b2 Create an object for tracking physical register usage. This will look
much better when I get rid of the reserved registers.

llvm-svn: 11066
2004-02-02 07:30:36 +00:00
Alkis Evlogimenos 9b9c0485fd Change weight array into a vector and make it as big as the number of
registers (not as the max number of registers).

Change toSpill from a std::set into a std::vector<bool>.

Use the reverse iterator adapter to do a reverse scan of allocatable
registers.

llvm-svn: 11061
2004-02-01 20:13:26 +00:00
Alkis Evlogimenos 5e05a59bf8 Use std::map::count() instead of std::map::find() != std::map::end()
where appropriate.

llvm-svn: 11060
2004-02-01 18:39:53 +00:00
Alkis Evlogimenos a3a56fa041 Change string for joined intervals.
llvm-svn: 11057
2004-02-01 16:13:05 +00:00
Alkis Evlogimenos 84a84c38b7 Change xor to ^.
llvm-svn: 11054
2004-02-01 08:19:25 +00:00
Chris Lattner cae054f59f Fix a bug in a recent checkin
llvm-svn: 11050
2004-02-01 05:25:07 +00:00
Alkis Evlogimenos 8d4f06ed84 Missed one silly assert :-)
llvm-svn: 11048
2004-02-01 02:21:31 +00:00
Alkis Evlogimenos 69deb4d236 Simplify joinIntervals() code.
llvm-svn: 11047
2004-02-01 02:18:31 +00:00
Alkis Evlogimenos 91dcc03c39 Use MRegisterInfo::isPhysicalRegister and
MRegisterInfo::isVirtualRegister.

llvm-svn: 11045
2004-02-01 01:27:01 +00:00
Alkis Evlogimenos 662bb3f495 Apply final part of Chris' patch.
llvm-svn: 11040
2004-01-31 23:48:47 +00:00
Alkis Evlogimenos 459a67c309 Be a little smarter on the way we handle physical register defs.
llvm-svn: 11038
2004-01-31 23:13:30 +00:00
Chris Lattner c330b98c1c Finegrainify namespacification, use new MRegisterInfo::isVirtualRegister
method

llvm-svn: 11037
2004-01-31 21:27:19 +00:00
Chris Lattner a2ef296994 Fix, correctly this time, the computation of the return value
Fix a spello
Tighten up the assertion checking

No functionality changes.

llvm-svn: 11036
2004-01-31 21:21:43 +00:00
Chris Lattner 626f431165 * Fix incorrect computation of the runOnMachineFunction return value
* Turn a bunch of instance variables into automatic variables

llvm-svn: 11035
2004-01-31 21:14:04 +00:00
Chris Lattner d835aa6711 Remove unneeded #includes
Move Passes.h (which defines the interface to this file) to the top.
Move statistics to the top of the file.
Add a comment

llvm-svn: 11034
2004-01-31 21:07:15 +00:00
Alkis Evlogimenos 50d97e33b7 Merge safe parts from last night's buggy commit. These do not break
any test cases :-)

llvm-svn: 11032
2004-01-31 19:59:32 +00:00