Commit Graph

559 Commits

Author SHA1 Message Date
Vikram S. Adve
cde3982b02 Don't pad variables in stack slots for performance!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4115 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-11 16:10:53 +00:00
Vikram S. Adve
aebdbe6988 Bug fix in folding getElementPtr instructions: don't fold one into
a predecessor if it has a non-zero first index and the predecessor
ends with a struct index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3982 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 22:55:05 +00:00
Vikram S. Adve
4117459567 Convert DIRS to PARALLEL_DIRS. They can be built independently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3972 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 11:52:14 +00:00
Vikram S. Adve
1c397aae8e Added a couple of helper methods for live range construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3970 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:05:43 +00:00
Vikram S. Adve
9d67cd1468 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3969 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:05:22 +00:00
Vikram S. Adve
f425884e27 Fixed method getReturnValue(): it should return NULL if the
callee does not return a value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3968 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:03:54 +00:00
Vikram S. Adve
ad9c978874 Fixed incorrect assertion: spill code for function ptr should be
handled like normal operands, not like other call arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3967 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:02:40 +00:00
Vikram S. Adve
1c10f17552 Sign-extend integer constants from original type size to 64 bits!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3958 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-27 14:26:20 +00:00
Vikram S. Adve
0efb50761d Add method IGNode::getCombinedDegree to count the sum of the degrees
of two nodes, excluding duplicates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3848 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:55:04 +00:00
Vikram S. Adve
57e14bd757 Add PostOpts/ and rename PreSelection/ to PreOpts/.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3847 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:53:53 +00:00
Vikram S. Adve
e8b57ef260 Add method MachineInstr::replace to rewrite a machine instruction in place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3843 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:47:49 +00:00
Vikram S. Adve
32f81a3469 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3842 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:45:47 +00:00
Vikram S. Adve
25d80cdcc6 Peephole optimization pass on final machine code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3840 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:42:11 +00:00
Vikram S. Adve
fafda59f08 Files moved to CodeGen/PreOpts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3839 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:30:46 +00:00
Vikram S. Adve
abf055c698 Moving these files from Code/PreSelection to here.
Original logs for PreSelection.cpp:

  revision 1.2
  date: 2002/09/17 23:50:32;  author: lattner;  state: Exp;  lines: +1 -3
  Don't put default parameter values into .cpp files, it breaks 3.x compilers

  revision 1.1
  date: 2002/09/16 15:31:13;  author: vadve;  state: Exp;
  New preselection pass that specializes LLVM code for a target machine,
  while remaining in legal portable LLVM form and preserving type
  information and type safety.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3838 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:29:28 +00:00
Chris Lattner
5fda99744e Don't put default parameter values into .cpp files, it breaks 3.x compilers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3799 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 23:50:32 +00:00
Chris Lattner
82f05d8610 Add support for GCC 2.96
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3777 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 17:23:09 +00:00
Vikram S. Adve
00020d3d01 Add subdirectory PreSelection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3739 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:32:07 +00:00
Vikram S. Adve
7f90ea209a New preselection pass that specializes LLVM code for a target machine,
while remaining in legal portable LLVM form and preserving type
information and type safety.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3738 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:31:13 +00:00
Vikram S. Adve
8c6936a58b Dump routine now writes out allocated register numbers if available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3737 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:18:53 +00:00
Vikram S. Adve
1318bed20c Improve and fix error in allocating stack slots: adjust alignment after adding
base address of the relevant region (instead of assuming that each region
is maximally aligned).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3736 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:18:16 +00:00
Vikram S. Adve
fd0ec80197 Add a version of ChooseRegOrImmed to handle numerical constants
introduced by InstrSelection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3735 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:15:57 +00:00
Vikram S. Adve
87fbcd99b4 Add an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3734 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:13:59 +00:00
Vikram S. Adve
993243e599 Fix typos in previous checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3726 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-15 15:33:48 +00:00
Chris Lattner
4bc2348008 RegAllocCommon no longer includes CommandLine.h so we have to include it
here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3725 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-15 07:07:55 +00:00
Vikram S. Adve
39c94e105f Break RA_DEBUG option into several levels to get better control over
debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3724 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 23:05:33 +00:00
Vikram S. Adve
521758fb79 Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3723 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 23:04:52 +00:00
Vikram S. Adve
7e914a967d Break RA_DEBUG option into several levels to get better output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3722 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 22:18:37 +00:00
Vikram S. Adve
7c26898401 Moving to lib/CodeGen/RegAlloc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3718 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 11:57:17 +00:00
Chris Lattner
597f81fea2 Fix a bug I introduced into the code generator. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3694 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-12 20:27:10 +00:00
Chris Lattner
106ff4551c - Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3681 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-11 01:21:29 +00:00
Chris Lattner
823c4abb58 Make sure the leakdetector is told about temporary Phi nodes also, so it doesn't
erroneously report them as leaks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3624 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-08 21:19:29 +00:00
Chris Lattner
a175ed4194 Inform the memory leak detector that TmpInstruction objects should not be
subject to memory leak checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3623 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-08 21:08:43 +00:00
Chris Lattner
0c4e886dbf - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3574 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-03 01:08:28 +00:00
Anand Shukla
b85d265b16 moved this file from lib/Reoptimizer/Mapping
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3519 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-27 22:47:33 +00:00
Anand Shukla
894e830100 Makefile for new sub directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3518 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-27 22:46:38 +00:00
Anand Shukla
2caa9204b2 Added Mapping subdir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3517 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-27 22:45:49 +00:00
Vikram S. Adve
74c83e44fa Use newly-added type inspection support in InstTreeNode subclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3501 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-24 21:02:09 +00:00
Vikram S. Adve
685133382d Moved code here to extract memory instruction indices and to check
whether FoldGetElemNodes should be called.  This is machine-independent
but was in the Sparc directory.  This is in a new function: GetMemInstArgs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3500 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-24 21:00:08 +00:00
Anand Shukla
6656c43ac7 Added #include <alloca.h>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3491 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-23 10:54:26 +00:00
Chris Lattner
cc63f1c674 Eliminated the MemAccessInst class, folding contents into GEP class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3487 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 23:37:20 +00:00
Vikram S. Adve
da920aa55b dumpNode() does not need to print MachineInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3444 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 02:59:46 +00:00
Vikram S. Adve
85af131d9e Unary Not (boolean and bitwise) is no longer a separate LLVM instruction
but is instead implemented with XOR.  Note that the InstrForest opLabels
for Not and BNot remain the same, i.e., the XOR is recognized and
represented as a (boolean or bitwise) Not when building the instruction
trees.  But these tree nodes are now binary, not unary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3343 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 14:19:22 +00:00
Vikram S. Adve
e2a78e3186 Add method MachineInstr::substituteValue() which substitutes
one Value with another one in all operands and implicit references
of the machine instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3306 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 16:52:58 +00:00
Chris Lattner
035dfbe7f2 * Removed extraneous #includes
* Fixed file headers to be consistent with the rest of LLVM
* Other minor fixes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3278 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-09 20:08:06 +00:00
Chris Lattner
179cdfb5c8 * Removed extraneous #includes
* Fixed file headers to be consistent with the rest of LLVM
* Other minor fixes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3277 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-09 20:08:03 +00:00
Chris Lattner
b91b31c12d We are using std::vector, so remove extraneous namespace prefixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3275 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-09 20:05:34 +00:00
Chris Lattner
b0cfa6dfec Very minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3271 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-09 18:55:18 +00:00
Chris Lattner
5f0eb8da62 - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3265 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-08 19:01:30 +00:00
Chris Lattner
dd5b495129 - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3264 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-08 19:01:28 +00:00
Vikram S. Adve
1b51b1b4f9 Add function GetConstantValueAsUnsignedInt.
Fix 2 bugs in FoldGetElemChain so index vector is not modified
when no GEPs are folded in, and so a hasLeadingZero is computed
only for the last folded GEP, not the one after that if any.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3244 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-04 20:49:49 +00:00
Chris Lattner
2e1749bbf8 * Move InstructionSelection Pass here instead of living in Sparc.cpp. It
is platform independant afterall.
* Object orientize the functions, cleanup code a bit.  Instead of static
  global functions, the helpers for instruction selection are now part of
  the InstructionSelection Pass class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3147 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 03:57:36 +00:00
Chris Lattner
67fcce2b19 Remove unused vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3143 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 02:52:40 +00:00
Chris Lattner
d8bbc06c87 Refix stuff for GCC 2.95, 3.0.4 & 3.1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3094 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 18:04:48 +00:00
Mehwish Nagda
e95ce74b80 now removes deleted nops from MachineCodeForInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3090 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 17:31:05 +00:00
Chris Lattner
0c0edf8afc *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3075 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 06:17:51 +00:00
Chris Lattner
cb6289a73d *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3058 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 21:21:33 +00:00
Chris Lattner
1089790546 Non-standard hash classes are not in the std:: namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3057 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 21:21:33 +00:00
Chris Lattner
09ff1126da *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3056 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 21:21:32 +00:00
Mehwish Nagda
6cf7849c1a moving to the Reoptimizer/Mapping dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2993 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 22:10:55 +00:00
Chris Lattner
5ff62e90d0 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2985 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 02:10:13 +00:00
Mehwish Nagda
cafc0d20bb changed size computation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2974 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-19 22:54:08 +00:00
Mehwish Nagda
e01166591f added check for Function with 0 BB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2942 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-17 23:40:33 +00:00
Mehwish Nagda
3115540870 Now will profile all Basic Blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2922 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 17:48:27 +00:00
Mehwish Nagda
b43086b4b7 Initial checking : Writes LLVM - MI mappiing to the .s file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2911 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-15 23:08:49 +00:00
Anand Shukla
e683f773a4 added std:: to endl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2875 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-11 00:17:17 +00:00
Vikram S. Adve
cd13e7a5ee Fix print of BB name in dump().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2861 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:45:30 +00:00
Vikram S. Adve
3bc9ef9317 Add support for marking each operand as a %hh, %hm, %lm or %lo.
Represent previous bools and these ones with flags in a single byte
per operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2860 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:45:04 +00:00
Anand Shukla
d58290ed3b changed mem_fun to std::mem_fun
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2847 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-09 19:18:56 +00:00
Vikram S. Adve
f5af636dbe 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2833 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:15:32 +00:00
Vikram S. Adve
c9a0ca5171 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2832 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:07:26 +00:00
Vikram S. Adve
45c3877b5c Rename static struct Initializer to avoid name conflict with BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2831 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:04:31 +00:00
Vikram S. Adve
432e1ca621 Fix printing of BB in dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2830 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:03:54 +00:00
Vikram S. Adve
1dcfd3c1a6 Moved class MachineCodeForBasicBlock to MachineCodeForBasicBlock.h.
This class is now an annotation on BasicBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2829 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:03:10 +00:00
Vikram S. Adve
bf82a42d1c MachineInstr::dump() now takes no arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2828 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:01:46 +00:00
Vikram S. Adve
11991ac70f Implementation of class MachineCodeForBasicBlock.
Moved here from MachineInstr.cpp to make it an annotation on BasicBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2827 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:01:11 +00:00
Vikram S. Adve
0baf1c0911 A single MachineInstr operand may now be both a def and a use,
so additional dep. edges have to be added.
This was needed to correctly handle conditional move instructions!
MachineCodeForBasicBlock is now an annotation on BasicBlock.
Renamed "earliestForNode" to "earliestReadyTimeForNode".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2826 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:59:23 +00:00
Vikram S. Adve
c2580ddb08 getUsableUniRegAtMI interface simplified slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2822 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:39:36 +00:00
Vikram S. Adve
7a4be9580e Moved class MachineCodeForBasicBlock to MachineCodeForBasicBlock.{cpp,h}.
An (explicit or implicit) operand may now be both a def and a use.
Also add a set of regs used by each instruction.
dump() no longer takes an optional argument, which doesn't work in gdb.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2821 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:38:45 +00:00
Vikram S. Adve
1871b2f1c2 MachineInstr* in vector are not const (and never really were)
because operands may be modified directly to set register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2820 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:34:40 +00:00
Chris Lattner
000f60d1b1 Remove tag that just clutters diffs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2807 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:08:25 +00:00
Anand Shukla
cfb22d3c14 changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2791 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:55:50 +00:00
Chris Lattner
7e70829632 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:24 +00:00
Chris Lattner
0b12b5f50e MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2778 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:21 +00:00
Chris Lattner
85c5465e07 Convert RegClass::IsColorUsedArr from a dynamically allocated array to
a vector.  This makes asserting on array bounds easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2731 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-23 15:50:03 +00:00
Chris Lattner
70e60cbd4d Move debug options out of header files so that the header does not have
to #include CommandLine.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2712 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:08:27 +00:00
Chris Lattner
e87adaac31 Avoid #including CommandLine.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2710 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:06:56 +00:00
Chris Lattner
ad86b74baf Hide debugging options
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2676 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 21:39:10 +00:00
Chris Lattner
5245f853c5 Don't lose namespace qualifications on previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2664 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 17:38:26 +00:00
Vikram S. Adve
0243ff9e62 InstrnsBefore and InstrnsAfter are now vectors instead of deques.
May be slightly less efficient but significantly reduces special
cases interfaces in code generation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2649 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:41:33 +00:00
Vikram S. Adve
36f0a9e5a6 Better folding getelementptr operations with mixed
array and struct indexes.
Update operand values in CallArgsDescriptor (a new class)
when replacing constant values with immediates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2645 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:34:29 +00:00
Vikram S. Adve
629b70f274 cpValue2Value now needs a vector of MachineInstr to store return values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2644 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:31:08 +00:00
Vikram S. Adve
7e684a956a Annotation class for MachineInstr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2643 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:30:21 +00:00
Vikram S. Adve
dabb41d93d 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2642 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:29:31 +00:00
Chris Lattner
9b625030c8 Replace all usages of Type::isPointerType with isa<PointerType>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2486 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:15:30 +00:00
Chris Lattner
86e9187dcc Add neccesary #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2406 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 18:48:55 +00:00
Chris Lattner
c6f3ae5c66 Eliminate duplicate or unneccesary #include's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2397 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 17:42:12 +00:00
Chris Lattner
96c466b06a Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2395 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 14:57:45 +00:00
Chris Lattner
97453d60c6 Include appropriate file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2379 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 20:40:16 +00:00
Chris Lattner
31bcdb822f Split ConstantVals.h into Constant.h and Constants.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:55:58 +00:00
Chris Lattner
1b7f7dc4b4 Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classes
to the global namespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2370 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 16:21:30 +00:00
Chris Lattner
8fc2f2072d Remove all contents of the cfg namespace to the global namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2369 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 16:19:42 +00:00
Chris Lattner
483e14ee04 s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2336 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 07:27:19 +00:00
Chris Lattner
f57b845547 * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2333 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 06:56:12 +00:00
Vikram S. Adve
d23a229c4c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2318 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:46:28 +00:00
Vikram S. Adve
4876209aa6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2312 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:34:15 +00:00
Vikram S. Adve
93240fe6b1 Improve printing during dumps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2311 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:31:18 +00:00
Vikram S. Adve
03d33bd264 Optional args are no longer allocated as they are discovered.
(This can be improved to avoid making the initial pass over the method.)
Also, ensure automatic vars and reg. spills areas are not extended
if their sizes are used for computing some other offset.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2310 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:30:43 +00:00
Chris Lattner
167b9629e1 Only emit message if DEBUG_RA is on
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2252 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-15 20:36:15 +00:00
Chris Lattner
73e214244f Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2216 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 19:48:49 +00:00
Chris Lattner
9bbf99de5f No need to reserve space, erasing does not change the size of the container.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2201 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 18:01:21 +00:00
Chris Lattner
af50d00829 * Add a file header with some information
* Delete the DelaySlotInfo objects created by the SchedulingManager class.
  These leaked objects were accounting for 3/4 of the memory leaked by the
  backend, so this is a relatively major win.
* Reorganize SchedulingManager::getDelaySlotInfoForInstr so that it has
  better code locality (making it easier to read).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2197 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 05:45:58 +00:00
Chris Lattner
f3dd05ca03 Clean up the ownership model a bit so that nodes actually get deleted more
frequently. This still leaks edges quite a bit, but it leaks no nodes
(I think).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2190 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 05:15:33 +00:00
Chris Lattner
0b0ffa0800 Convert AddedInstrMapType to contain AddedInstrns by value instead of by
pointer so that they do not all get leaked!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2188 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 05:13:04 +00:00
Chris Lattner
244212a80b GCC3.0 is reported to die without an alloca definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2186 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 03:37:11 +00:00
Chris Lattner
7884cd17aa Don't leak memory like a seive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2185 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 23:09:07 +00:00
Chris Lattner
69a34cddaf Value cannot be directly instantiated. I think that this code was TRYING to
make a PHI node, although it was badly broken.  This keeps tests passing, so
we'll go with it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2184 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 22:05:54 +00:00
Chris Lattner
b7653df085 s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2180 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 22:03:57 +00:00
Chris Lattner
4d669b510c s/method/function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2177 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 22:01:15 +00:00
Chris Lattner
2fbfdcffd3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2144 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-07 20:49:59 +00:00
Vikram S. Adve
1f81861028 Add method clearCallInterference().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2071 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 18:58:14 +00:00
Vikram S. Adve
fa79e6e869 Include temp. values when computing max. size of stack frame!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2070 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 18:57:49 +00:00
Vikram S. Adve
1792779edf Fix a bug in previous bug fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2069 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 18:56:51 +00:00
Vikram S. Adve
1a53f03392 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2068 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 18:54:37 +00:00
Chris Lattner
79df7c0aaa Change references from Method to Function
change references from MethodARgument to FunctionArgument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1991 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-26 18:01:55 +00:00
Vikram S. Adve
9c4f7268c6 Destroy MethodLiveVarInfo after register allocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1976 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:54:03 +00:00
Vikram S. Adve
97fb99bc54 Use deterministic iterator for SchedGraphs. This is actually not
useful right now when we only do local scheduling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1975 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:53:03 +00:00
Vikram S. Adve
1392d6903c Bug fix: nextToTry was not being initialized in one case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1974 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:46:15 +00:00
Vikram S. Adve
7c7e46ae5f Add option to disable scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1973 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:45:35 +00:00
Vikram S. Adve
802cec485f Add option to disable scheduling.
Destroy live-variable information after scheduling so it is
recomputed before later phases (e.g., reg. allocation).
Use deterministic iterator to enumerate sched graphs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1972 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:44:55 +00:00
Vikram S. Adve
cf8a98f2c2 Minor changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1971 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:40:59 +00:00
Vikram S. Adve
ded1bf8cd8 Re-fix bug: Put back MachineCodeForInstruction::dropAllReferences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1970 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:40:11 +00:00
Vikram S. Adve
e4e4d4e2f9 Fix padding for variables allocated on stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1969 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:39:26 +00:00
Vikram S. Adve
c941b87397 Major overhaul to FoldGetElemPtr to handle mixed array and struct refs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1968 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:37:53 +00:00
Vikram S. Adve
4e7bc49b54 Use deterministic iterator for treeRoots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1967 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:36:52 +00:00
Vikram S. Adve
d95919cbd0 Change treeRoots data structure to make enumeration deterministic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1962 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:24:00 +00:00
Chris Lattner
e7506a366e Rename Method to Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1957 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-23 22:51:58 +00:00
Vikram S. Adve
23a4c8fcb5 Big bug fix: getUsableUniRegAtMI needed to return values in arguments
but did not pass the arguments by reference!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1906 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:37:19 +00:00
Vikram S. Adve
89e2da034a Added function computeOffsetforLocalVar to check how big the
offset-from-FP will be before allocating space for a local variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1905 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:36:30 +00:00
Vikram S. Adve
c356e565a6 Bug fix in setting CC register.
Also use distinct names for the three types of SetMachineOperand
to avoid painful overloading problems and errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1904 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:35:24 +00:00
Vikram S. Adve
42f632041d Constants are now added to the constant pool only when a load
instruction is actually generated for them.
Rename the different versions of SetMachineOperand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1903 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:33:43 +00:00
Vikram S. Adve
1ed009f66e Use vector for machine instructions returned by GetInstructionsByRule.
Fix constants in instructions generated for Phi elimination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1902 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:31:54 +00:00
Vikram S. Adve
705f95e0b7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1901 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:26:48 +00:00
Anand Shukla
155d2c9384 Change to make it build with GCC 2.95.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1802 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 18:57:15 +00:00
Chris Lattner
b91ca1f7d6 * Make it compile with GCC 3.0.4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1788 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-24 23:01:56 +00:00
Chris Lattner
dfb8b95c2d * Silence signed/unsigned warnings
* Make it compile with GCC 3.0.4


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1787 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-24 23:01:50 +00:00
Chris Lattner
455889aa79 * Pull BasicBlock::pred_* and BasicBlock::succ_* out of BasicBlock.h and into
llvm/Support/CFG.h
* Make pred & succ iterators for intervals global functions
* Add #includes that are now neccesary because BasicBlock.h doesn't include
  InstrTypes.h anymore


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1750 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-12 22:39:50 +00:00
Chris Lattner
221d688a5e 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1746 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-12 21:07:25 +00:00
Chris Lattner
2f898d2074 Convert operand iterator over to work like an STL iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1720 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 06:02:59 +00:00
Chris Lattner
748697d242 Minor change: Methods that return ValueSet's that are guaranteed to be valid
return references instead of pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1719 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 04:20:12 +00:00
Chris Lattner
3773094a1d * Code Cleanups
* Removal dependencies on Type.h & remove uses of getTypeID()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1718 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 03:52:29 +00:00
Chris Lattner
569ea239f0 * Code Cleanups of IGNode.h
* Removal of getTypeID() methods, and dependence on llvm/Type.h, from IGNode & LiveRange


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1717 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 03:51:37 +00:00
Chris Lattner
7471a7b019 Must include SetOperations to do set_*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1716 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 03:35:53 +00:00
Chris Lattner
296b7730e3 * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1712 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 02:52:05 +00:00
Chris Lattner
5e5dfa307a * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1711 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 02:51:01 +00:00
Chris Lattner
0665a5f1f5 * Code Cleanups
* Introduce RAV to allow stream I/O instead of using printValue


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1710 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 01:43:49 +00:00
Chris Lattner
4996084acf * Add a #include not indirectly included any more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1707 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 00:35:14 +00:00
Chris Lattner
4d7fc119b8 * RegisterAllocation _uses_ LiveVar analysis, instead of creating it's own copy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1701 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 20:02:38 +00:00
Chris Lattner
9adb7ad457 * The itf exposed by InstrScheduling is now a single function to create the right pass
* InstructionScheduling is now a real pass
* InstrSched _uses_ LiveVar analysis, instead of creating it's own copy many times
  through a loop.  In this was LiveVarAnalysis is actually even SHARED by Register
  allocation.
* SchedPriorities is now passed the live var information in


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1700 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 20:02:16 +00:00
Chris Lattner
14ab1ce020 Switch register allocator over to using LoopInfo directly instead of indirectly through LoopDepthCalculator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1696 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 17:48:00 +00:00
Chris Lattner
4911c357e1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1695 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 17:39:42 +00:00
Chris Lattner
3e0f8288e7 Make #include "llvm/Analysis/LoopDepth.h" be an internal artifact of how register allocation is implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1693 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 17:38:48 +00:00
Chris Lattner
30adeb6d07 * Add #includes removed from headers
* ValueSet interface converted from add/remove to insert/erase
* Minor cleanups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1689 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 16:36:59 +00:00
Chris Lattner
f35f2fbbc2 Remove dependence on BBLiveVar from InstrScheduling
Minor cleanups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1688 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 16:35:45 +00:00
Chris Lattner
2f9b28e59a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1681 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 15:54:09 +00:00
Chris Lattner
0a8ed9401d Add #includes neccesary since they were removed from .h files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1675 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 05:56:09 +00:00
Chris Lattner
b99bd2b145 Move instrIsFeasible from InstrScheduling.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1674 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 05:55:42 +00:00
Chris Lattner
2182c785c2 * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1672 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 05:52:08 +00:00
Chris Lattner
77f66c131d * Move command line parsing debug stuff to InstrScheduling internal header file
SchedPriorities.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1669 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 02:44:20 +00:00
Chris Lattner
6dd98a6c31 Split RegisterAllocation stuff OUT of Sparc.cpp into a well defined pass
that has a very minimal interface (like it should have).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1667 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-04 00:33:08 +00:00
Chris Lattner
f2868ce228 Code pulled out of MAchineInstr.(h|cpp)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1660 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-03 07:54:50 +00:00
Chris Lattner
dd1e40b4ce Lots of code cleanups, no functional changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1650 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-03 07:46:34 +00:00
Chris Lattner
3801f6d383 * Prune #includes
* Remove MachineCodeFor(Method|VMInstr) code to their own .cpp files


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1649 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-03 07:46:01 +00:00
Chris Lattner
fb3b1ec982 * Switch over to cleaner TmpInstruction model
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1648 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-03 07:39:06 +00:00
Chris Lattner
06cb1b7382 * Straighten out #includes
* Switch to MAchineCodeForInstruction model instead of MachineCodeForVMInstr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1647 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-03 07:33:46 +00:00
Chris Lattner
a8bbb6bced * Swich to annotation model for MachineCodeForInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1646 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-03 07:31:41 +00:00
Chris Lattner
de6dbabaee Remove extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1645 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-03 07:30:08 +00:00
Chris Lattner
0861b0c3e6 * Straighten out #includes
* Switch from MachineCodeForVMInstr to MachineCodeForInstruction model


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1644 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-03 07:29:45 +00:00
Chris Lattner
3462cae44f * Get machine instrs from Instructin's by using MachineCodeForInstruction::get
* Convert a few (*X). to X->


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1643 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-03 07:28:30 +00:00
Chris Lattner
29f4c06b7f Add a class forward decl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1637 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-03 07:13:04 +00:00
Chris Lattner
92a12d5c6b LoopDepth calculation is now in CFG namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1601 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-31 00:41:13 +00:00
Chris Lattner
a16c3efb9f Make it build with 2.95.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1554 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-23 05:47:57 +00:00
Chris Lattner
dbe5304f77 Oops lost a parenthesis somehow :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1504 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-21 01:33:12 +00:00
Chris Lattner
697954c15d Changes to build successfully with GCC 3.02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-20 22:54:45 +00:00
Ruchira Sasanka
ce773da223 Fixed a bug in spill cost estimation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1500 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-08 16:29:23 +00:00
Ruchira Sasanka
6a3db8c117 PhyRegAlloc.cpp: Added temp area resetting before every call
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1499 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-07 21:09:06 +00:00
Ruchira Sasanka
4f3eb22e1f Added destructors and comments.
Added correct spill candidate selection logic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1493 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-07 19:19:18 +00:00
Ruchira Sasanka
42bd177eae Added comments, destructors where necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1491 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-07 19:16:26 +00:00
Vikram S. Adve
fa24897f9f Eliminate all uses of memInst->getIndicesBROKEN().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1485 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-15 00:36:32 +00:00
Chris Lattner
7a17675206 Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1408 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-04 00:03:30 +00:00
Chris Lattner
e9bb2df410 Rename ConstPoolVal -> Constant
Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1407 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-03 22:26:30 +00:00
Chris Lattner
7061dc50b2 Split the PHINode class out from the iOther.h file into the iPHINode.h file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1405 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-03 18:02:31 +00:00
Chris Lattner
cee8f9ae67 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1400 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-27 00:03:19 +00:00
Chris Lattner
4ed17bad69 Stuff after a #endif is not valid CPP input and breaks some compilers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1375 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-26 18:56:52 +00:00
Chris Lattner
69a86e4e23 The old getIndices has been deprecated, because it no longer works. It now
is named getIndicesBROKEN() and shall be removed when the codebase is updated
to not call it


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1338 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-26 16:56:19 +00:00
Ruchira Sasanka
f90870f622 Commented some popTempArg.. since it leads to a bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1326 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-15 22:02:06 +00:00
Ruchira Sasanka
07c7086bd2 Added naming to inserted phi copy values - for easy debugging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1325 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-15 20:46:40 +00:00
Ruchira Sasanka
ba9d5dba25 Fixed a bug in setReLRegsUsedByMI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1323 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-15 20:23:19 +00:00
Ruchira Sasanka
825dd55429 Changed some names of methods, added const etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1322 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-15 20:22:37 +00:00
Vikram S. Adve
7c47c7201d Modify AllocateLocalVar method to take a size argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1318 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-15 15:22:26 +00:00