Commit Graph

231 Commits

Author SHA1 Message Date
Chris Lattner c75dc4856e Add new method
llvm-svn: 5309
2003-01-15 20:28:36 +00:00
Chris Lattner a23969b669 #include RegClass.h explicitly
llvm-svn: 5307
2003-01-15 19:57:07 +00:00
Chris Lattner 19a7cb2240 Remvoe dependency on RegClass.h
llvm-svn: 5306
2003-01-15 19:56:21 +00:00
Chris Lattner 8128936c33 Use buildmi not MI ctor directly
llvm-svn: 5293
2003-01-15 18:08:07 +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 de1d729747 Move llvm/Analysis/LiveVar/ValueSet.h to CodeGen/ValueSet.h
llvm-svn: 5282
2003-01-14 22:56:37 +00:00
Chris Lattner b4d58d7f9e Rename MachineInstrInfo -> TargetInstrInfo
llvm-svn: 5272
2003-01-14 22:00:31 +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 871e591e34 Rename MachineFrameInfo to TargetFrameInfo.h
llvm-svn: 5199
2002-12-28 21:00:25 +00:00
Chris Lattner 0733616ec7 Frame info moved out of MachineFunction into a seperate object
llvm-svn: 5192
2002-12-28 20:35:34 +00:00
Chris Lattner 660bf10981 Use higher level methods, don't use TargetInstrDescriptors directly!
llvm-svn: 4389
2002-10-29 17:35:39 +00:00
Chris Lattner 76014b97af Remove #include, misleading comment, and a typedef used only once
llvm-svn: 4383
2002-10-29 17:08:05 +00:00
Chris Lattner 6d6d87f3f3 Inline typedef, eliminate unused method
llvm-svn: 4382
2002-10-29 17:03:19 +00:00
Chris Lattner ca0f818347 Remove long dead #if 0
llvm-svn: 4381
2002-10-29 17:00:19 +00:00
Chris Lattner 5abe44bb72 Add #includes that were eliminated from headers
llvm-svn: 4380
2002-10-29 16:51:05 +00:00
Chris Lattner 189c099a7f De-inline methods
llvm-svn: 4379
2002-10-29 16:50:33 +00:00
Chris Lattner c9e9d2933d Remove #include
llvm-svn: 4378
2002-10-29 16:50:20 +00:00
Chris Lattner e9bda57b87 Remove unneeded #include
llvm-svn: 4377
2002-10-29 16:50:06 +00:00
Chris Lattner a13000449e Remove forward decl
llvm-svn: 4376
2002-10-29 16:49:44 +00:00
Chris Lattner 7ecc7af4bd Make assertIGNode be private to the InterferenceGraph.cpp file
llvm-svn: 4375
2002-10-29 16:42:34 +00:00
Chris Lattner b1e39b5a27 Rename some regalloc fields
llvm-svn: 4346
2002-10-28 19:43:23 +00:00
Chris Lattner c9bd2c38a8 Eliminate usage of MachineBasicBlock::get
llvm-svn: 4344
2002-10-28 19:22:04 +00:00
Chris Lattner 6a30b02b1d Rename the redundant MachineOperand::getOperandType() to MachineOperand::getType()
llvm-svn: 4331
2002-10-28 04:45:29 +00:00
Chris Lattner 9668c8c8db Add #includes now that MachineInstr.h doesn't include llvm/Target/MachineInstrInfo.h
llvm-svn: 4327
2002-10-28 02:28:39 +00:00
Chris Lattner 2a3bd1c562 *** empty log message ***
llvm-svn: 4323
2002-10-28 02:01:37 +00:00
Chris Lattner 6fc3ca062d *** empty log message ***
llvm-svn: 4317
2002-10-28 01:41:27 +00:00
Misha Brukman 7ae7f84cf3 Changed `MachineCodeForMethod' to `MachineFunction'.
llvm-svn: 4301
2002-10-28 00:28:31 +00:00
Chris Lattner 5ae3bd630d Ensure definate initialization
llvm-svn: 4263
2002-10-22 23:34:11 +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 3e54d6c3be Major bug fix: spill code for an instruction in a delay slot was
merrily being inserted before/after the instruction!

llvm-svn: 4116
2002-10-11 16:12:40 +00:00
Vikram S. Adve 9011903ee2 Added a couple of helper methods for live range construction.
llvm-svn: 3970
2002-09-28 17:05:43 +00:00
Vikram S. Adve ed2df3ecf8 Live ranges for Return value and return address of a Call are now
created here, simply by handling all implicit operands (which should
have been done anyway).

llvm-svn: 3969
2002-09-28 17:05:22 +00:00
Vikram S. Adve 8fef3b8033 Fixed incorrect assertion: spill code for function ptr should be
handled like normal operands, not like other call arguments.

llvm-svn: 3967
2002-09-28 17:02:40 +00:00
Vikram S. Adve 5cc5d4b19a Add method IGNode::getCombinedDegree to count the sum of the degrees
of two nodes, excluding duplicates.

llvm-svn: 3848
2002-09-20 00:55:04 +00:00
Vikram S. Adve e008b2d62e Allow copy coalescing in more cases: if sum of node degrees is more than
than #available regs, compute the sum excluding duplicates and if that
is less than #regs, go ahead and coalesce.
Add method IGNode::getCombinedDegree to count excluding duplicates.

llvm-svn: 3842
2002-09-20 00:45:47 +00:00
Vikram S. Adve 580b851d23 Fix typos in previous checkin.
llvm-svn: 3726
2002-09-15 15:33:48 +00:00
Chris Lattner a73d6653f6 RegAllocCommon no longer includes CommandLine.h so we have to include it
here.

llvm-svn: 3725
2002-09-15 07:07:55 +00:00
Vikram S. Adve 0e56b36b53 Break RA_DEBUG option into several levels to get better control over
debug output.

llvm-svn: 3724
2002-09-14 23:05:33 +00:00
Vikram S. Adve d171a8c7c5 Remove unnecessary include.
llvm-svn: 3723
2002-09-14 23:04:52 +00:00
Vikram S. Adve c9f1e71360 Break RA_DEBUG option into several levels to get better output.
llvm-svn: 3722
2002-09-14 22:18:37 +00:00
Vikram S. Adve a8f926c0c1 Moving to lib/CodeGen/RegAlloc.
llvm-svn: 3718
2002-09-14 11:57:17 +00:00
Chris Lattner 02e7a86fec * Removed extraneous #includes
* Fixed file headers to be consistent with the rest of LLVM
* Other minor fixes

llvm-svn: 3277
2002-08-09 20:08:03 +00:00
Chris Lattner 40eb9dafed - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument

llvm-svn: 3264
2002-08-08 19:01:28 +00:00
Chris Lattner e583333ec9 Non-standard hash classes are not in the std:: namespace
llvm-svn: 3057
2002-07-24 21:21:33 +00:00
Chris Lattner f5cad15a67 *** empty log message ***
llvm-svn: 2985
2002-07-22 02:10:13 +00:00
Anand Shukla 046fe57511 changed mem_fun to std::mem_fun
llvm-svn: 2847
2002-07-09 19:18:56 +00:00
Vikram S. Adve 7228f0c404 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.
-- 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.
-- class MachineCodeForBasicBlock is now an annotation on BasicBlock.

llvm-svn: 2833
2002-07-08 23:15:32 +00:00
Vikram S. Adve 1dfb4079b7 MachineInstr* in vector are not const (and never really were)
because operands may be modified directly to set register.
Also, class MachineCodeForBasicBlock is now an annotation on BasicBlock.

llvm-svn: 2832
2002-07-08 23:07:26 +00:00
Vikram S. Adve beb364051b getUsableUniRegAtMI interface simplified slightly.
llvm-svn: 2822
2002-07-08 22:39:36 +00:00
Vikram S. Adve ff045b2e18 MachineInstr* in vector are not const (and never really were)
because operands may be modified directly to set register.

llvm-svn: 2820
2002-07-08 22:34:40 +00:00
Chris Lattner dec26513ad Remove tag that just clutters diffs
llvm-svn: 2807
2002-06-30 16:08:25 +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 113f4f4609 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2779
2002-06-25 16:13:24 +00:00
Chris Lattner abe98198a8 Convert RegClass::IsColorUsedArr from a dynamically allocated array to
a vector.  This makes asserting on array bounds easier.

llvm-svn: 2731
2002-05-23 15:50:03 +00:00
Chris Lattner afc86e9a35 Move debug options out of header files so that the header does not have
to #include CommandLine.h.

llvm-svn: 2712
2002-05-22 17:08:27 +00:00
Chris Lattner d5ed3694ae Avoid #including CommandLine.h
llvm-svn: 2710
2002-05-22 17:06:56 +00:00
Chris Lattner 99bd13b415 Hide debugging options
llvm-svn: 2676
2002-05-20 21:39:10 +00:00
Chris Lattner 9af99f8c74 Don't lose namespace qualifications on previous patch.
llvm-svn: 2664
2002-05-20 17:38:26 +00:00
Vikram S. Adve 5d78db2afb InstrnsBefore and InstrnsAfter are now vectors instead of deques.
May be slightly less efficient but significantly reduces special
cases interfaces in code generation.

llvm-svn: 2649
2002-05-19 15:41:33 +00:00
Vikram S. Adve 2780d2dacb Numerous bug fixes:
-- 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 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: 2642
2002-05-19 15:29:31 +00:00
Chris Lattner d5a847057b Eliminate duplicate or unneccesary #include's
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner 37104aace8 Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.

llvm-svn: 2395
2002-04-29 14:57:45 +00:00
Chris Lattner 50cf8f1871 Include appropriate file
llvm-svn: 2379
2002-04-28 20:40:16 +00:00
Chris Lattner 78dd56fe62 Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classes
to the global namespace

llvm-svn: 2370
2002-04-28 16:21:30 +00:00
Chris Lattner 002958cdbb Remove all contents of the cfg namespace to the global namespace
llvm-svn: 2369
2002-04-28 16:19:42 +00:00
Chris Lattner f998685cd9 s/Method/Function
llvm-svn: 2336
2002-04-27 07:27:19 +00:00
Chris Lattner c8e665431b * Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well

llvm-svn: 2333
2002-04-27 06:56:12 +00:00
Vikram S. Adve 40221aa74c Don't record instructions for copying method arguments in the
AddedInstrns sets for the first machine instruction.  It is hard
to ensure that the right order is preserved, and sure enough, the
order was broken.  Instead, use a separate set for the function entry.

llvm-svn: 2318
2002-04-25 04:46:28 +00:00
Vikram S. Adve 7a4b381f80 Don't record instructions for copying method arguments in the
AddedInstrns sets for the first machine instruction.  It is hard
to ensure that the right order is preserved, and sure enough, the
order was broken.  Instead, use a separate set for the function entry.

llvm-svn: 2312
2002-04-25 04:34:15 +00:00
Chris Lattner 75323bc2d2 Only emit message if DEBUG_RA is on
llvm-svn: 2252
2002-04-15 20:36:15 +00:00
Chris Lattner 30e23dacbc Convert AddedInstrMapType to contain AddedInstrns by value instead of by
pointer so that they do not all get leaked!

llvm-svn: 2188
2002-04-09 05:13:04 +00:00
Chris Lattner f739fa8541 s/Method/Function
llvm-svn: 2180
2002-04-08 22:03:57 +00:00
Chris Lattner 95f65b6f84 s/method/function
llvm-svn: 2177
2002-04-08 22:01:15 +00:00
Chris Lattner 62b7fd136e Change references to the Method class to be references to the Function
class.  The Method class is obsolete (renamed) and all references to it
are being converted over to Function.

llvm-svn: 2144
2002-04-07 20:49:59 +00:00
Vikram S. Adve c533f04176 Add method clearCallInterference().
llvm-svn: 2071
2002-03-31 18:58:14 +00:00
Vikram S. Adve aa2373d2ed Bug fix: address used by indirect call instruction should also
be marked as having a Call Interference, even though it may not
be live after the call.

llvm-svn: 2068
2002-03-31 18:54:37 +00:00
Vikram S. Adve 7a78ae9dd6 Destroy MethodLiveVarInfo after register allocation.
llvm-svn: 1976
2002-03-24 03:54:03 +00:00
Chris Lattner 4e8c4877aa Rename Method to Function
llvm-svn: 1957
2002-03-23 22:51:58 +00:00
Vikram S. Adve 8e01c0b70e Big bug fix: getUsableUniRegAtMI needed to return values in arguments
but did not pass the arguments by reference!

llvm-svn: 1906
2002-03-18 03:37:19 +00:00
Vikram S. Adve cecde7122c Big bug fix: getUsableUniRegAtMI needed to return values in arguments
but did not pass the arguments by reference!
Also added a function to get a register class by ID.

llvm-svn: 1901
2002-03-18 03:26:48 +00:00
Chris Lattner 60a6591d83 Method.h no longer includes BasicBlock.h
Method::inst_* is now in llvm/Support/InstIterator.h
GraphTraits specializations for BasicBlock and Methods are now in llvm/Support/CFG.h

llvm-svn: 1746
2002-02-12 21:07:25 +00:00
Chris Lattner ea13e0afa0 Convert operand iterator over to work like an STL iterator
llvm-svn: 1720
2002-02-05 06:02:59 +00:00
Chris Lattner 7e5ee4253c Minor change: Methods that return ValueSet's that are guaranteed to be valid
return references instead of pointers.

llvm-svn: 1719
2002-02-05 04:20:12 +00:00
Chris Lattner d30f989cda * Code Cleanups
* Removal dependencies on Type.h & remove uses of getTypeID()

llvm-svn: 1718
2002-02-05 03:52:29 +00:00
Chris Lattner f1223ace96 * Code Cleanups of IGNode.h
* Removal of getTypeID() methods, and dependence on llvm/Type.h, from IGNode & LiveRange

llvm-svn: 1717
2002-02-05 03:51:37 +00:00
Chris Lattner 101a5d9197 Must include SetOperations to do set_*
llvm-svn: 1716
2002-02-05 03:35:53 +00:00
Chris Lattner b0af9cdbda * Eliminate the LiveVarSet class, making applyTranferFuncForMInst a static
function in the one .cpp file that uses it.  Use ValueSet's instead.
* Prepare to delete LiveVarSet.h & LiveVarSet.cpp
* Eliminate the ValueSet class, making all old member functions into global
  templates that will eventually be moved to Support.
* Eliminate some irrelevant const's

llvm-svn: 1712
2002-02-05 02:52:05 +00:00
Chris Lattner b1def732af * Eliminate the LiveVarSet class, making applyTranferFuncForMInst a static
function in the one .cpp file that uses it.  Use ValueSet's instead.
* Prepare to delete LiveVarSet.h & LiveVarSet.cpp
* Eliminate the ValueSet class, making all old member functions into global
  templates that will eventually be moved to Support.

llvm-svn: 1711
2002-02-05 02:51:01 +00:00
Chris Lattner 30e8fb69c5 * Code Cleanups
* Introduce RAV to allow stream I/O instead of using printValue

llvm-svn: 1710
2002-02-05 01:43:49 +00:00
Chris Lattner 3da53ad636 * Add a #include not indirectly included any more
llvm-svn: 1707
2002-02-05 00:35:14 +00:00
Chris Lattner aa7a151874 * RegisterAllocation _uses_ LiveVar analysis, instead of creating it's own copy
llvm-svn: 1701
2002-02-04 20:02:38 +00:00
Chris Lattner 347a23921a Switch register allocator over to using LoopInfo directly instead of indirectly through LoopDepthCalculator
llvm-svn: 1696
2002-02-04 17:48:00 +00:00
Chris Lattner 8a352d597c Make LoopDeptCalculator be an internal artifact of how RegAlloc is implemented,
do not expose it.  Additionally, have it be auto generated by the pass framework
for us.

llvm-svn: 1695
2002-02-04 17:39:42 +00:00
Chris Lattner 669a74ce8a Make #include "llvm/Analysis/LoopDepth.h" be an internal artifact of how register allocation is implemented.
llvm-svn: 1693
2002-02-04 17:38:48 +00:00
Chris Lattner 83a8434eb2 * Add #includes removed from headers
* ValueSet interface converted from add/remove to insert/erase
* Minor cleanups

llvm-svn: 1689
2002-02-04 16:36:59 +00:00
Chris Lattner f48173a875 Convert RegisterAllocator interface to opaque pass type, so that users do not
need to know _anything_ about RegAlloc to use it.  Well in the end maybe.

llvm-svn: 1681
2002-02-04 15:54:09 +00:00
Chris Lattner 49562d8442 Add #includes neccesary since they were removed from .h files
llvm-svn: 1675
2002-02-04 05:56:09 +00:00
Chris Lattner b0da8b2de1 * Minor cleanups
* Reduce number of #includes, sometimes drastically (LiveRangeInfo.h lost _7_)
* Move instrIsFeasible() from InstrScheduling.h to SchedPriorities.h
* Delete blank lines at end of files

llvm-svn: 1672
2002-02-04 05:52:08 +00:00
Chris Lattner 36aa542ef0 Split RegisterAllocation stuff OUT of Sparc.cpp into a well defined pass
that has a very minimal interface (like it should have).

llvm-svn: 1667
2002-02-04 00:33:08 +00:00
Chris Lattner abafc3bc70 Lots of code cleanups, no functional changes
llvm-svn: 1650
2002-02-03 07:46:34 +00:00