Commit Graph

55 Commits

Author SHA1 Message Date
Chris Lattner e0b49952f6 Fix PR294
llvm-svn: 12425
2004-03-16 01:45:55 +00:00
Alkis Evlogimenos c31ff795d5 Simplify iterator usage now that we have next(). Also don't pass iterators by reference now that MachineInstr* are in an ilist
llvm-svn: 11732
2004-02-23 04:12:30 +00:00
Alkis Evlogimenos d0a60b71fc Rename reloads/spills to loads/stores.
llvm-svn: 11619
2004-02-19 06:19:09 +00:00
Chris Lattner a8d97e4e74 Finegrainify namespacification
Remove one of the operands of a two operand instruction

llvm-svn: 11478
2004-02-15 21:38:28 +00:00
Alkis Evlogimenos bbf53937a4 Make dense maps keyed on physical registers smallerusing
MRegisterInfo::getNumRegs() instead of
MRegisterInfo::FirstVirtualRegister.

Also use MRegisterInfo::is{Physical,Virtual}Register where
appropriate.

llvm-svn: 11477
2004-02-15 21:37:17 +00:00
Alkis Evlogimenos 8cdd0215bf Remove getAllocatedRegNum(). Use getReg() instead.
llvm-svn: 11393
2004-02-13 21:01:20 +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
Chris Lattner 5dd5be3ec3 Do not use MachineOperand::isVirtualRegister either!
llvm-svn: 11283
2004-02-10 21:12:22 +00:00
Alkis Evlogimenos aaba4639f8 Change interface of MachineOperand as follows:
a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
    b) add isUse(), isDef()
    c) rename opHiBits32() to isHiBits32(),
              opLoBits32() to isLoBits32(),
              opHiBits64() to isHiBits64(),
              opLoBits64() to isLoBits64().

This results to much more readable code, for example compare
"op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used
very often in the code.

llvm-svn: 10461
2003-12-14 13:24:17 +00:00
Brian Gaeke 960707c335 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell 482202a601 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Alkis Evlogimenos 5f1f337d95 Change MRegisterDesc::AliasSet, TargetInstrDescriptor::ImplicitDefs
and TargetInstrDescriptor::ImplicitUses to always point to a null
terminated array and never be null. So there is no need to check for
pointer validity when iterating over those sets. Code that looked
like:

if (const unsigned* AS = TID.ImplicitDefs) {
  for (int i = 0; AS[i]; ++i) {
    // use AS[i]
  }
}

was changed to:

for (const unsigned* AS = TID.ImplicitDefs; *AS; ++AS) {
  // use *AS
}

llvm-svn: 8960
2003-10-08 05:20:08 +00:00
Misha Brukman 7eb05a170a Spell `necessary' correctly.
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Brian Gaeke 89207943a1 Factory methods for FunctionPasses now return type FunctionPass *.
llvm-svn: 7823
2003-08-13 18:18:15 +00:00
Chris Lattner 74e4e9b44f Set debug types
llvm-svn: 7533
2003-08-03 21:47:31 +00:00
Chris Lattner 1007f033d4 Move DEBUG to Debug.h
llvm-svn: 7497
2003-08-01 22:21:34 +00:00
Vikram S. Adve 7366fa1aa6 (1) Added special register class containing (for now) %fsr.
Fixed spilling of %fcc[0-3] which are part of %fsr.

(2) Moved some machine-independent reg-class code to class TargetRegInfo
    from SparcReg{Class,}Info.

(3) Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
    and related functions and flags.  Fixed several bugs where only
    "isDef" was being checked, not "isDefAndUse".

llvm-svn: 6341
2003-05-27 00:05:23 +00:00
Chris Lattner b4d58d7f9e Rename MachineInstrInfo -> TargetInstrInfo
llvm-svn: 5272
2003-01-14 22:00:31 +00:00
Chris Lattner cbedb8b400 * Use the PHI Elimination pass
llvm-svn: 5220
2003-01-13 00:26:08 +00:00
Chris Lattner ca4362fee7 Rename FunctionFrameInfo to MachineFrameInfo
llvm-svn: 5200
2002-12-28 21:08:26 +00:00
Chris Lattner bf9d12ac8b * Convert to be a MachineFunctionPass instance
* Use new FunctionFrameInfo object to manage stack slots instead of doing
  it directly
* Adjust to new MRegisterInfo API
* Don't take a TM as a ctor argument
* Don't keep track of which callee saved registers are modified
* Don't emit prolog/epilog code or spill/restore code for callee saved regs
* Use new allocation_order_begin/end iterators to simplify dramatically the
  logic for picking registers to allocate
* Machine PHI nodes can no longer contain constant arguments

* Use a bitvector to keep track of registers used instead of a set
* Fix problem where explicitly referenced registers would be added to
  regsused set and never removed

llvm-svn: 5196
2002-12-28 20:42:14 +00:00
Chris Lattner ee73450749 Adjustments to work with the simpler spill interface
llvm-svn: 5144
2002-12-25 05:04:20 +00:00
Chris Lattner 095eac8109 Fix compilation on GCC 2.96
llvm-svn: 5113
2002-12-23 23:44:04 +00:00
Chris Lattner dc451c6d27 Implicit defs/uses list may be empty.
llvm-svn: 5103
2002-12-18 01:11:14 +00:00
Chris Lattner ac5f3b3ed3 Use new reginfo interface
llvm-svn: 5099
2002-12-17 04:19:40 +00:00
Chris Lattner 1d84f0a461 Keep the stack frame aligned.
llvm-svn: 5081
2002-12-16 17:42:40 +00:00
Chris Lattner c63d63a7c7 Rename createSimpleX86RegisterAllocator to createSimpleRegisterAllocator.
Remvoe some dead code

llvm-svn: 5070
2002-12-16 14:37:00 +00:00
Chris Lattner bc1e6700eb Some simpliciations to the spill/reload interface
llvm-svn: 5067
2002-12-15 23:01:26 +00:00
Chris Lattner 4e560ee65b Simplify PHI node elimination significantly by doing it as a prepass to
register allocation

llvm-svn: 5066
2002-12-15 22:39:53 +00:00
Chris Lattner 292083aaf5 Variety of small or trivial simplifications to the code, completely eliminated
the dependence on PhysRegClassMap

llvm-svn: 5064
2002-12-15 22:19:19 +00:00
Chris Lattner 2af545d034 Remove unused savePhysRegToStack method
llvm-svn: 5061
2002-12-15 21:33:51 +00:00
Chris Lattner ed594b6b20 Localize a map, remove another
llvm-svn: 5060
2002-12-15 21:24:30 +00:00
Chris Lattner 1499e5a92c Give simple reg allocator a nice Pass Name
llvm-svn: 5058
2002-12-15 21:13:12 +00:00
Chris Lattner 2979a85984 Add a big assert making sure 2 address instructions are formed right
llvm-svn: 5057
2002-12-15 21:02:20 +00:00
Chris Lattner 02e835bf9a Fix a problem that occurs when PHI nodes have multiple entries for the same predecessor
llvm-svn: 5055
2002-12-15 20:48:03 +00:00
Chris Lattner dfa238f665 Grab bag of minor cleanups. Export some statistics about the number of
spills and reloads emitted

llvm-svn: 5054
2002-12-15 20:36:09 +00:00
Chris Lattner e2533336f5 Simplify interfaces used by regalloc to insert code
llvm-svn: 5052
2002-12-15 20:06:35 +00:00
Chris Lattner c1c7cc290f * Simplify code a bit by breaking the PHI node handling stuff out into a seperate
function from normal regalloc code
* Make the regalloc for a block a function instead of part of runOnMachineBB, which
  makes it easier to see what's going on in runOnMBB.

llvm-svn: 5051
2002-12-15 19:51:14 +00:00
Chris Lattner f2acd842b4 * Remove some unneccesary instance variables
* Make allocateStackSpaceFor only allocate the right amount of space

llvm-svn: 5048
2002-12-15 19:07:34 +00:00
Chris Lattner b772cd05c5 pull inverse reg class mapping into a class that is sharable and out of the
target register description classes.

llvm-svn: 5045
2002-12-15 18:38:59 +00:00
Chris Lattner cf1955cb16 Prune #includes
llvm-svn: 5044
2002-12-15 18:19:24 +00:00
Chris Lattner 1af3af463a Remove extraneous #includes, perform FIXME
llvm-svn: 5043
2002-12-15 18:15:24 +00:00
Chris Lattner 477af9d0fa Fix borkness with not using MachineBasicBlocks in PHI nodes
llvm-svn: 5035
2002-12-15 08:02:51 +00:00
Misha Brukman a1aa29b125 Fixed a bug where moves due to phis were being neglected.
llvm-svn: 5019
2002-12-13 12:33:31 +00:00
Misha Brukman 86ca8840a1 Need to insert all moves due to PHI nodes before *ALL* jumps in a predecessor
basic block, as there could be multiple.

llvm-svn: 5016
2002-12-13 11:55:59 +00:00
Misha Brukman 35a358d981 This should be more correct: invalidates physical registers that are used in
an instruction to avoid using them to allocate to other virtual registers.

llvm-svn: 5013
2002-12-13 11:33:22 +00:00
Misha Brukman 89ff3fbcd6 Fixed bug with running out of registers. Also, reinstated namespace which
disappeared during the last checkin.

llvm-svn: 5007
2002-12-13 10:42:31 +00:00
Misha Brukman a739167305 This should handle register allocating PHI nodes.
llvm-svn: 5002
2002-12-13 09:54:36 +00:00
Misha Brukman 4ef74c8079 Start allocating stack space at [ebp-4] to not overwrite the return address.
Also make all loads & stores 4-byte aligned for performance. ;)

llvm-svn: 4982
2002-12-13 04:34:02 +00:00
Misha Brukman 260dbc79fc Take advantage of our knowledge of 2-address X86 instructions and
register-allocated them appropriately.

llvm-svn: 4976
2002-12-12 23:20:31 +00:00