Commit Graph

106 Commits

Author SHA1 Message Date
Vikram S. Adve 2353584afc Add code to support stack spill/temp offsets that don't fit in the
immed. field.  Moved insertCallerSavingCode() to PhyRegAlloc: it is
now machine independent.  Remove all uses of PhyRegAlloc.

llvm-svn: 7391
2003-07-29 19:53:21 +00:00
Vikram S. Adve 536b19220c (1) Major fix to the way unused regs. are marked and found for the FP
Single and FP double reg types (which share the same reg class).
    Now all methods marking/finding unused regs consider the regType
    within the reg class, and SparcFloatRegClass specializes this code.
(2) Remove machine-specific regalloc. methods that are no longer needed.
    In particular, arguments and return value from a call do not need
    machine-specific code for allocation.
(3) Rename TargetRegInfo::getRegType variants to avoid unintentional
    overloading when an include file is omitted.

llvm-svn: 7334
2003-07-25 21:12:15 +00:00
Chris Lattner c783297812 Simplify code a bit
llvm-svn: 7217
2003-07-21 19:56:49 +00:00
Anand Shukla bd2d0577fb Added special consideration for instrumentation strategy
llvm-svn: 7208
2003-07-20 15:39:30 +00:00
Vikram S. Adve 6528067646 Several fixes to handling of int CC register:
(1) An int CC live range must be spilled if there are any interferences,
    even if no other "neighbour" in the interf. graph has been allocated
    that reg. yet.  This is actually true of any class with only one reg!

(2) SparcIntCCRegClass::colorIGNode sets the color even if the LR must
    be spilled so that the machine-independent spill code doesn't have to
    make the machine-dependent decision of which CC name to use based on
    operand type: %xcc or %icc.  (These are two halves of the same register.)

(3) LR->isMarkedForSpill() is no longer the same as LR->hasColor().
    These should never have been the same, and this is necessary now for #2.

(4) All RDCCR and WRCCR instructions are directly generated with the
    phony number for %ccr so that EmitAssembly/EmitBinary doesn't have to
    deal with this.

llvm-svn: 7151
2003-07-10 19:42:11 +00:00
Vikram S. Adve d09c4c34c0 Major bug fix though it happened rarely (only on a compare after an
integer overflow):
We need to use %icc and not %xcc for comparisons on 32-bit or smaller
integer values.

llvm-svn: 7111
2003-07-06 20:13:59 +00:00
Vikram S. Adve b5f8ada255 Bug/case fixes:
(1) select: Ok to convert a pointer to a float or double.
(2) regalloc: Some MachineInstr* for caller-saving code before a call
    were being inserted before and after the call!
(3) Don't insert the caller-saving instructions in the
    MachineCodeForInstruction for the Call instruction.
    *All* instructions generated by register allocation need to be
    recorded in those maps, but it needs to be done uniformly.

llvm-svn: 7051
2003-07-02 01:13:57 +00:00
Chris Lattner cb9ef2bccc Fix invalid number of arguments problem
llvm-svn: 6692
2003-06-16 12:03:00 +00:00
Misha Brukman 2969ec5266 * Changed Bcc instructions to behave like BPcc instructions
* BPA and BPN do not take a %cc register as a parameter
* SLL/SRL/SRA{r,i}5 are there for a reason - they are ONLY 32-bit instructions
* Likewise, SLL/SRL/SRAX{r,i}6 are only 64-bit
* Added WRCCR{r,i} opcodes

llvm-svn: 6655
2003-06-06 09:52:23 +00:00
Anand Shukla e6c3ee6b07 Add map info for arguments to call (copies)
llvm-svn: 6503
2003-06-01 02:48:23 +00:00
Vikram S. Adve a83804a29a Extensive changes to the way code generation occurs for function
call arguments and return values:
Now all copy operations before and after a call are generated during
selection instead of during register allocation.
The values are copied to virtual registers (or to the stack), but
in the former case these operands are marked with the correct physical
registers according to the calling convention.
Although this complicates scheduling and does not work well with
live range analysis, it simplifies the machine-dependent part of
register allocation.

llvm-svn: 6465
2003-05-31 07:32:01 +00:00
Misha Brukman af96d39c04 Added 'r' and 'i' annotations to instructions as SparcInstr.def has changed.
llvm-svn: 6377
2003-05-27 22:40:34 +00:00
Vikram S. Adve 8adb9944aa Added special register class containing (for now) %fsr.
Fixed spilling of %fcc[0-3] which are part of %fsr.
Moved some machine-independent reg-class code to class TargetRegInfo
from SparcReg{Class,}Info.

llvm-svn: 6339
2003-05-27 00:02:22 +00:00
Misha Brukman 352f7ac072 Namespacified `vector' and `cerr' to always use the `std::' namespace.
Eliminated `using' directives.

llvm-svn: 6261
2003-05-21 17:59:06 +00:00
Misha Brukman 56f4fa10fd Sparc instruction opcodes now all live under the `V9' namespace.
llvm-svn: 6249
2003-05-20 20:32:24 +00:00
Chris Lattner b1eee00034 Remove wierd printout
llvm-svn: 6145
2003-05-12 20:10:12 +00:00
Chris Lattner 4f596d7a2c Fix warnings
llvm-svn: 5316
2003-01-15 21:36:30 +00:00
Chris Lattner f9fd59148c Adjust to simpler interfaces
Eliminate dependency on RegClass.h

llvm-svn: 5315
2003-01-15 21:14:32 +00:00
Chris Lattner a23969b669 #include RegClass.h explicitly
llvm-svn: 5307
2003-01-15 19:57:07 +00:00
Chris Lattner 90fc665489 Move private header to private directory
llvm-svn: 5305
2003-01-15 19:50:44 +00:00
Chris Lattner d840ccd2e0 Prune #includes
llvm-svn: 5303
2003-01-15 19:48:13 +00:00
Chris Lattner 1ebaa90f48 Use BuildMI more, Create*Instruction less
llvm-svn: 5291
2003-01-15 17:47:49 +00:00
Chris Lattner 24c1d5e551 Rename llvm/Analysis/LiveVar/FunctionLiveVarInfo.h -> llvm/CodeGen/FunctionLiveVarInfo.h
llvm-svn: 5284
2003-01-14 23:05:08 +00:00
Chris Lattner f9781b59ab More renamings of Target/Machine*Info to Target/Target*Info
llvm-svn: 5204
2002-12-29 03:13:05 +00:00
Chris Lattner d47aac9d4b * Rename machineFrameInfo to targetFrameInfo
* Constant pool and frame info is no longer directly in MachineFunction

llvm-svn: 5177
2002-12-28 20:21:29 +00:00
Chris Lattner 69127c68ed Remove unneccesary #includes
llvm-svn: 4408
2002-10-29 20:47:46 +00:00
Chris Lattner 9bebf832c8 Don't pass default args
llvm-svn: 4354
2002-10-28 20:10:56 +00:00
Chris Lattner 780090bbf1 Don't bother passing in default value
llvm-svn: 4347
2002-10-28 19:46:25 +00:00
Chris Lattner e3aa50d6b7 Fixes to work with updated RegAlloc
llvm-svn: 4345
2002-10-28 19:32:07 +00:00
Chris Lattner 6a30b02b1d Rename the redundant MachineOperand::getOperandType() to MachineOperand::getType()
llvm-svn: 4331
2002-10-28 04:45:29 +00:00
Misha Brukman 7ae7f84cf3 Changed `MachineCodeForMethod' to `MachineFunction'.
llvm-svn: 4301
2002-10-28 00:28:31 +00:00
Chris Lattner ce64eddb71 - Two minor improvements to the MachineInstr class to reduce footprint and
overhead: Merge 3 parallel vectors into 1, change regsUsed hash_set to be a
    bitvector.  Sped up LLC a little less than 10% in a debug build!

llvm-svn: 4261
2002-10-22 23:16:21 +00:00
Vikram S. Adve 92ccbb9f27 Print "circular" warning message only in debug mode.
llvm-svn: 4170
2002-10-14 16:32:49 +00:00
Vikram S. Adve 879eac9fa1 Eliminate duplicate target pointer. Also add a few assertions.
llvm-svn: 4128
2002-10-13 00:05:30 +00:00
Vikram S. Adve 6d1036d41b Live ranges for Return value and return address of a Call are no longer
created here.  Instead they are created in LiveRangeInfo.cpp.  This
simplifies the code here quite a bit.

llvm-svn: 3965
2002-09-28 16:59:05 +00:00
Chris Lattner b0b412e66e - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.

llvm-svn: 3574
2002-09-03 01:08:28 +00:00
Chris Lattner 56e9166b84 - Clean up interface to Sparc register handling a bit:
- Eliminate Sparc*Order classes, moving contents to Sparc*Class classes
   - get register name methods now return const char * const pointers instead
     of std::string's.
   - Added file header comments to SparcRegClassInfo.(cpp|h)
   - Moved BIG constant arrays out of SparcRegClassInfo.h, into
     SparcRegInfo.cpp.  This should allow a LOT of std::string constructors to
     not have to be called.

llvm-svn: 3295
2002-08-12 21:25:05 +00:00
Chris Lattner 3091e11726 GCC 3.1 changes, finally the burm file builds the FIRST time a clean directory is built.
llvm-svn: 3073
2002-07-25 06:08:32 +00:00
Chris Lattner e98dd5fcac *** empty log message ***
llvm-svn: 3056
2002-07-24 21:21:32 +00:00
Vikram S. Adve 4aee77c70b More important fixes:
-- FP argument to a function with no prototype going on stack
   was not being copied to the stack in colorCallArgs().
-- Put caller-saving code *before* argument copying code so that
   we don't trash a register before saving it!
-- Two other minor fixes.

llvm-svn: 2855
2002-07-10 21:36:00 +00:00
Anand Shukla 7e882db2f4 Added std:: to mem_fun for 64-bit gcc
llvm-svn: 2845
2002-07-09 19:16:59 +00:00
Vikram S. Adve aee6701e63 Significant changes to correctly spill CC registers and to correctly
handle conditional move instructions:
-- cpMem<->Reg functions now support CC registers (int and FP) correctly.
   Also, cpMem<->Reg functions now return a vector of machine instructions.
-- Scratch registers must be explicitly provided to cpMem<->Reg when
   needed, since CC regs need one to be copied to/from memory.
-- CC regs are saved to a scratch register instead of stack.
-- All regs used by a instruction are now recorded in MachineInstr::regsUsed,
   since regs used to save values *across* an instruction are not obvious
   either from the operands or from the LiveVar sets.
-- An (explicit or implicit) operand may now be both a def and a use.
   This is needed for conditional move operations.
   So an operand may need spill code both before and after the instruction.

Other changes:
-- Added several get{Class,Type} functions.
-- Added unified-to-local register number conversion.
-- class MachineCodeForBasicBlock is now an annotation on BasicBlock.
-- Suggest/Color methods may modify the MachineInstr (and always did),
   so don't make that argument const!
-- Caller-saving code doesn't need its special purpose code for
   handling CC registers since cpMem<->Reg handle those correctly now.

llvm-svn: 2834
2002-07-08 23:23:12 +00:00
Anand Shukla 458496c060 changes to make it compatible with 64bit gcc
llvm-svn: 2791
2002-06-25 20:55:50 +00:00
Chris Lattner 7076ff29ed MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2778
2002-06-25 16:13:21 +00:00
Chris Lattner 070cf77a40 Disable debugging output
llvm-svn: 2756
2002-06-04 03:09:57 +00:00
Vikram S. Adve e9327f0082 Numerous bug fixes:
-- correct sign extensions for integer casts and for shift-by-constant
   instructions generated for integer multiply
-- passing FP arguments to functions with more than 6 arguments
-- passing FP arguments to varargs functions
-- passing FP arguments to functions with no prototypes
-- incorrect stack frame size when padding a section
-- folding getelementptr operations with mixed array and struct indexes
-- use uint64_t instead of uint for constant offsets in mem operands
-- incorrect coloring for CC registers (both int and FP): interferences
   were being completely ignored for int CC and were considered but no
   spills were marked for fp CC!

Also some code improvements:
-- better interface to generating machine instr for common cases
   (many places still need to be updated to use this interface)
-- annotations on MachineInstr to communicate information from
   one codegen phase to another (now used to pass information about
   CALL/JMPLCALL operands from selection to register allocation)
-- all sizes and offests in class TargetData are uint64_t instead of uint

llvm-svn: 2640
2002-05-19 15:25:51 +00:00
Chris Lattner d5a847057b Eliminate duplicate or unneccesary #include's
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner f998685cd9 s/Method/Function
llvm-svn: 2336
2002-04-27 07:27:19 +00:00
Chris Lattner 93ddab25e8 Simplify code a bit
llvm-svn: 2322
2002-04-27 02:24:17 +00:00
Vikram S. Adve a6d94c9a76 Major changes to how int and FP arguments are handled. Varargs
function calls were simply wrong; other functions were just not
using all available registers.

llvm-svn: 2316
2002-04-25 04:42:21 +00:00