Commit Graph

812 Commits

Author SHA1 Message Date
Chris Lattner
cf3056db0f Regularize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:32:08 +00:00
Misha Brukman
aa41c3ca20 * Doxygenified comments
* Wrap code at 80 columns
* Ordered includes according to LLVM style guide


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9020 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:41:32 +00:00
Alkis Evlogimenos
73ff5120eb 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
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8960 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-08 05:20:08 +00:00
Alkis Evlogimenos
7237ecef13 Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8819 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-02 16:57:49 +00:00
Chris Lattner
797c136607 include passes.h which defines the interface this file exposes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8793 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-30 20:13:59 +00:00
Brian Gaeke
222bd53c2c Update head-of-file comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8699 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 18:16:23 +00:00
Brian Gaeke
6a256cc37c Untabify tabs in stuff I've recently added.
Check in my register allocator state-saving code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8698 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 18:08:54 +00:00
Brian Gaeke
59b1c566c9 Use getRegClassID() instead of getRegClass()->getID(), since it's there.
Shorten the markSuggestedColorUsable method.
Add a switch for saving reg. alloc. state (coming soon).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8697 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 17:50:28 +00:00
Brian Gaeke
eefaeb84f1 Remove some unused methods of class IGNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8696 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 04:29:52 +00:00
Chris Lattner
8474f6fcda Move getAnalysisUsage method from header to .cpp file. Add a normal file
header comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8679 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-23 15:13:04 +00:00
Brian Gaeke
bd353fb662 Use C++ math header instead of C version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8648 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 03:57:37 +00:00
Brian Gaeke
37bc4cce9b Erase now-unused prototypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8647 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:51:00 +00:00
Brian Gaeke
874f423f54 Rearrange #includes ... since there are fewer now I guess it's a win.
(I also zapped printMachineCode() and printLabel() at the previous checkin,
but forgot to mention it.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8646 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:50:21 +00:00
Brian Gaeke
5779ef2ce0 Standardize the names of include guards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8645 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:31:37 +00:00
Brian Gaeke
fdb2596c77 Standardize the names of include guards.
Remove more excess whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8644 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:31:25 +00:00
Brian Gaeke
6264fb70c1 Standardize the names of include guards.
Fix typos in file header comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8643 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:31:15 +00:00
Brian Gaeke
43ce8fe477 I tried to standardize the formatting and tidy up the huge amount of
excess whitespace a little. Also improved some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8642 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:24:09 +00:00
Brian Gaeke
4efe342424 Convert PhyRegAlloc into a proper pass.
PhyRegAlloc.cpp:
 Don't include TargetMachine.h or TargetRegInfo.h, because these are provided
  by PhyRegAlloc.h.
 Merge class RegisterAllocator into class PhyRegAlloc.
 Simplify & move ctor, dtor to PhyRegAlloc.h.
 Make some of PhyRegAlloc's reference members into pointer members,
  so they can be more easily messed with.
 MarkAllocatedRegs() becomes a member method, with fewer args.

PhyRegAlloc.h:
 Include Pass.h, TargetMachine.h and TargetRegInfo.h. Don't declare
  TargetRegInfo forward.
 Give AddedInstrns the obvious clear() method.
 Make some of PhyRegAlloc's reference members into pointer members,
  so they can be more easily messed with.
 Add prototype for markAllocatedRegs().
 Remove unused inline void constructLiveRanges().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8641 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 01:23:46 +00:00
Misha Brukman
6eba07a6a3 Fixed spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8588 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-17 21:34:23 +00:00
Brian Gaeke
305f02dd64 Fix typo in comment. Take out some random whitespace.
(Partial merge from my working file)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8564 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 15:38:05 +00:00
Brian Gaeke
d0534a863a Edit comment for accuracy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8562 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 15:36:50 +00:00
Vikram S. Adve
bed4effb84 Add flag to control whether or not delay slots are filled during
instruction scheduling (this is off by default).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8553 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 05:55:15 +00:00
Brian Gaeke
41de073b04 Fix typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8523 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 05:28:42 +00:00
Misha Brukman
37f92e2568 Fixed spelling and grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8489 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 22:34:13 +00:00
Chris Lattner
be4063babd Don't build dead directories
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8308 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:34:15 +00:00
Chris Lattner
79a4e8e2d6 Remove dead library makefile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8304 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:29:43 +00:00
Chris Lattner
02b81351f9 Remove makefile for dead library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8303 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:26:52 +00:00
Chris Lattner
84681f1184 LiveRange.h is now in lib/CodeGen/RegAlloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8299 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:17:13 +00:00
Chris Lattner
893f9541dc LiveRangeInfo got moved into the lib/CodeGen/RegAlloc directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8297 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:12:17 +00:00
Chris Lattner
70b2f56e76 PhyRegAlloc.h got moved to lib/CodeGen/RegAlloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8296 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:09:04 +00:00
Chris Lattner
c083dcccbf Move IGNode from public include directory to here. Minor cleanups like adding std:: namespace qualifiers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8295 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:05:47 +00:00
John Criswell
c9afb499f6 Fixed two double free bugs that caused llc to segfault or run forever.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8191 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 21:43:17 +00:00
Tanya Lattner
3b6b6ba4be Removing README
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8180 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 17:17:59 +00:00
Tanya Lattner
4f839ccf49 Putting my revised version of ModuloScheduling in cvs. This is not complete...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8179 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 17:12:14 +00:00
Tanya Lattner
8dc9982e2e Moved index into BB to common graph class because its needed by ModuloSchedGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8174 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 15:30:40 +00:00
Tanya Lattner
d6d863392f Added/removed header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8160 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-27 15:12:24 +00:00
Tanya Lattner
c50ee556e5 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8153 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-27 02:42:58 +00:00
Tanya Lattner
b6489f3153 First version of SchedGraph common class and refactoring of SchedGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8148 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-25 22:42:20 +00:00
Chris Lattner
41822c790f Fix bug: Jello/2003-08-23-RegisterAllocatePhysReg.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8095 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 23:49:42 +00:00
Misha Brukman
ef6a6a69ff The word dependent' has no a'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8030 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 22:14:26 +00:00
Chris Lattner
e287cfdfd0 Fix spello
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8029 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 22:05:57 +00:00
Misha Brukman
5560c9d49c Spell `necessary' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 14:43:39 +00:00
Chris Lattner
128c2aa493 Fix bug: Jello/2003-08-15-AllocaAssertion.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7916 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-17 18:01:15 +00:00
Brian Gaeke
53b99a0fe7 Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7906 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 21:19:25 +00:00
Chris Lattner
e3561c23c2 Remove uses of the NonCopyable class, to make the doxygen output look better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7880 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 05:20:06 +00:00
Chris Lattner
79ba7c1aee rename selection directory and library to SelectionDAG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7877 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 04:55:22 +00:00
Chris Lattner
7dc97ff180 Add a bunch of new node types, etc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7875 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 04:53:16 +00:00
Brian Gaeke
bf3c4cfaad Factory methods for function passes now return type FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7839 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:09:32 +00:00
Brian Gaeke
277aad2655 Factory methods for function passes now return type FunctionPass *.
Get rid of RegisterLLC, which can't handle FunctionPasses anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7836 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:04:49 +00:00
Brian Gaeke
19df3876e6 Factory methods for FunctionPasses now return type FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7823 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:18:15 +00:00
Chris Lattner
7f2438f170 Mapping directory no longer exists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7801 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 02:37:24 +00:00
Chris Lattner
c09f429499 Obsolete file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7799 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 02:27:13 +00:00
Vikram S. Adve
feb3298fca For instructions in a delay slot of another instruction,
we no longer need to find the live-before set of the delayed
branch since that set is now included the live-before/after
set of the instructions in each delay slot.  Just assert that instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7796 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 22:22:24 +00:00
Chris Lattner
fa7ed53f32 Build the SelectionDAG library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7718 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 14:57:48 +00:00
Chris Lattner
78ec311bd5 Initial checkin of SelectionDAG implementation. This is still rough and
unfinished


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7717 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 14:57:33 +00:00
Vikram S. Adve
2010f7baec Fix assertion in MachineInstr::substituteValue().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7675 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-07 15:01:48 +00:00
Chris Lattner
3fd1f5bb6a Use a new local data structure instead of the MachineInstr::regsUsed set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7621 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 22:11:13 +00:00
Chris Lattner
c393c57afc Add a map
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7620 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 22:09:31 +00:00
Chris Lattner
6ae3117582 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7619 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 22:03:27 +00:00
Chris Lattner
3bed95b628 Physical registers no longer live in the regsUsed set for each machine instr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7618 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 21:55:58 +00:00
Chris Lattner
610234d5c9 Do not insert physical regsiters into the regsUsed set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7617 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 21:55:20 +00:00
Chris Lattner
a2dd745613 All callers of these methods actually wanted them to preserve the flags,
so get rid of the def/use parameters that were getting passed in.

**** This now changes the semantics of these methods to preserve the flags,
     not clobber them!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7602 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 16:58:46 +00:00
Chris Lattner
8c8194500d Fix bugs handling ESP in alloca references
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7591 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 04:13:58 +00:00
Chris Lattner
d9ac6a7d3b Revert previous change, and be really anal about what physical registers can do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7588 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 00:49:09 +00:00
Chris Lattner
27615d7f21 Don't bother calculating info unless its needed. May reduce number of stack slots created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7584 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 23:42:37 +00:00
Chris Lattner
b8822ad224 * Fix spelling of 'necessary'
* Add a lot more DEBUG output, which is better structured than before
* Fix bug: Jello/2003-08-04-PhysRegLiveFailure.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7583 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 23:36:39 +00:00
Chris Lattner
e109de3166 Simplify code, eliminating the need for the X86 isVoid target instr flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7534 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:51:45 +00:00
Chris Lattner
4cc662b0ef Set debug types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7533 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:47:31 +00:00
Chris Lattner
925b771dc3 Remove using decl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7531 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 20:24:29 +00:00
Chris Lattner
d3fd79f699 Wrap at 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7503 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 13:49:03 +00:00
Chris Lattner
a11136b16c Move DEBUG to Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7497 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:21:34 +00:00
Vikram S. Adve
b5161b60c2 All constant-evaluation code now unified into
TargetInstrInfo::ConvertConstantToIntType().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7390 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:50:12 +00:00
Vikram S. Adve
814030a0c5 1. Bug fix: Don't use branch operand reg. as temp. reg. when
spilling values used by an instruction in the delay slot of the branch
   (which will eventually be moved before the branch).
2. Bug fix:  Delete the delay slot instr, not the branch instr, when
   moving delay slot instr. out!!!!
3. Move code to insert caller-saves moved here from SparcRegInfo:
   it is now machine-independent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7389 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:49:21 +00:00
Vikram S. Adve
b403b2c019 Add const version of getLiveRangeForValue().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7386 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:38:22 +00:00
Vikram S. Adve
102f295114 Code to insert caller-saves moved here from SparcRegInfo: it is now
machine-independent.
Fix problem with using branch operand reg. as temp. reg. when
spilling values used by an instruction in the delay slot of the branch
(which will eventually be moved before the branch).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7385 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:37:41 +00:00
Chris Lattner
8d3f8e226d Making this code const-correct would be a pain, so I'll hack it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7350 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:29:51 +00:00
Chris Lattner
9e2dd8f8d7 Const correctness fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7349 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:24:56 +00:00
Chris Lattner
9cdaa63f57 Be const correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7348 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:23:41 +00:00
Chris Lattner
e5a61ccdc5 Hrm, another necesary one :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7347 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:22:19 +00:00
Chris Lattner
1d598fa25a Remove #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7342 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:01:04 +00:00
Chris Lattner
bae47e5691 Remove extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7341 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:00:29 +00:00
Vikram S. Adve
bc001b24a1 (1) Change the way unused regs. are marked and found to consider regType
info (since multiple reg types may share the same reg class).
(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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7329 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:06:09 +00:00
Vikram S. Adve
34a856749f Remove unused field. Change the way unused regs. are marked and
found to consider regType info (since multiple reg types may share
the same reg class, e.g., single and double on Sparc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7327 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:00:13 +00:00
Chris Lattner
c8bf87af3e Remove unnecessary casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7250 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:17:51 +00:00
Chris Lattner
9daa8a12d3 Random cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7247 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 14:59:40 +00:00
Chris Lattner
1815383276 Remove using decl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7246 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 14:55:59 +00:00
Vikram S. Adve
4d2faf6307 Values stored in CallArgsDescriptor cannot be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7156 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:46:15 +00:00
Vikram S. Adve
24d0410db0 isMarkedForSpill() should be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7155 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:45:28 +00:00
Vikram S. Adve
627eb31cd7 Change interface to MachineInstr::substituteValue to specify more precisely
which args can be substituted: defsOnly, defsAndUses or usesOnly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7154 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:45:07 +00:00
Vikram S. Adve
51bda6fccb Print out all neighbors in interference graph, not just higher-numbered ones.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7153 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:43:33 +00:00
Vikram S. Adve
3bf089227b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7152 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:42:55 +00:00
Vikram S. Adve
97539fc4b6 Choose register instead of immediate for ConstantExpr in ChooseRegOrImmed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7112 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 20:33:21 +00:00
Vikram S. Adve
65b2f401af Minor beautification: fold a couple of lines of code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7054 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:24:00 +00:00
Vikram S. Adve
74d15d36f5 A def. operand of a machine instruction may be an ordinary Value*,
not just an Instruction*, at least in one unfortunate case:
the first operand to the va_arg instruction.
Modify ValueToDefVecMap to map from Value*, not Instruction*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7052 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:16:01 +00:00
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +00:00
Chris Lattner
3889a2cb05 Remove a ton of extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6842 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 03:08:05 +00:00
Chris Lattner
2eb9a257c8 Actually, change it to use explicit new/delete, which is more likely to be
optimized INTO an alloca


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6727 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 22:29:09 +00:00
Chris Lattner
0bf9476701 Remove two using decls
Remove usage of alloca


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6725 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 22:18:28 +00:00
Brian Gaeke
ad95d9ef50 Isolate machine-dependent use of <alloca.h> in "Support/Alloca.h",
so that we can easily change its use to be conditional on the result of
an autoconf test later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6723 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 21:54:01 +00:00
John Criswell
be583b914d Included assert.h so that the code compiles under newer versions of GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6682 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-11 14:01:36 +00:00
Guochun Shi
0e93687cca add some comments
add a function ModuloScheduling::dumpFinalSchedule() to print out final schedule


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6677 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 20:04:30 +00:00
Guochun Shi
e95b827db2 add an brief instruction what this pass is
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6676 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 20:03:39 +00:00
Guochun Shi
0b970dad72 a simple introduction to this pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6675 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 20:02:16 +00:00
Guochun Shi
f325261856 cleaned code
add some comments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6674 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 19:09:00 +00:00
Guochun Shi
8f1d4ab409 delete useless functions
add comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6673 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-08 23:16:07 +00:00
Guochun Shi
33280524f4 change DEBUG to DEBUG_PRINT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6672 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-08 20:40:47 +00:00
Misha Brukman
6fe6905df2 Do not hastily change the Opcode from 'r' to 'i' type if we're not actually
SETTING the operand to be an immediate or have verified that one of the operands
is really a SignExtended or Unextended immediate value already, which warrants
an 'i' opcode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6662 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-07 02:34:43 +00:00
Chris Lattner
08d2e4e09a Fix bug: Jello/2003-06-04-bzip2-bug.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6624 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 17:15:04 +00:00
Misha Brukman
d15cd2752f I have finally seen the light. The code to change the opcode must live higher in
the loop, and in both cases. In the first case, it is a VReg that is a constant
so it may be actually converted to a constant. In the second case, it is already
a constant, but then if it doesn't change its type (e.g. to become a register
and have the value loaded from memory if it is too large to live in its
instruction field), we must change the opcode BEFORE the 'continue', otherwise
we miss the opportunity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6602 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 04:54:06 +00:00
Misha Brukman
d720da23db Pass through the emitConstantPool() call to the real emitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6590 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 20:00:49 +00:00
Misha Brukman
c740aae220 Moved code to modify the opcode from 'reg' to 'imm' form to a more logical place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6563 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 03:18:20 +00:00
Misha Brukman
0ee48d24fe Moved FInfo.cpp to lib/Target/Sparc as it is Sparc-specific.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6554 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 23:27:09 +00:00
Chris Lattner
78ddcd7b03 Minor cleanups.
This pass should be moved to lib/Target/Sparc since it's sparc specific
It also needs a file comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6553 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 22:57:41 +00:00
Chris Lattner
9efc4d6aaa Remove usage of noncopyable classes to clean up doxygen output.
In particular these classes are the last that link the noncopyable classes
with the hash_map, vector, and list classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6552 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 22:45:07 +00:00
Chris Lattner
747a044550 Add #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6550 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 22:05:13 +00:00
Misha Brukman
e6aa9e30b1 Removed a useless ofstream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6547 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 20:49:09 +00:00
Guochun Shi
099b064a46 compiled with the new SchedGraphCommon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6545 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 17:48:56 +00:00
Misha Brukman
53a7ba851d Remove spurious assert()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6529 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 04:10:41 +00:00
Chris Lattner
efc84a4082 Changes to be compatible with MachineCodeEmitter.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6515 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-01 23:22:11 +00:00
Vikram S. Adve
5cdb12f958 Minor changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6470 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 07:41:54 +00:00
Vikram S. Adve
f3d3ca18b5 Added MachineCodeForInstruction object as an argument to
TmpInstruction constructors because every TmpInstruction object has
to be registered with a MachineCodeForInstruction to prevent leaks.
This simplifies the user's code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6469 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 07:41:24 +00:00
Vikram S. Adve
3497782f38 Allow explicit physical registers for implicit operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6468 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 07:39:06 +00:00
Vikram S. Adve
7952d6088e Changes to allow explicit physical register arguments that have been
preallocated.  While reg-to-reg dependences were already handled, this
change required new code for adding edges to/from call instructions.
This was part of the extensive changes to the way code generation occurs
for function call arguments and return values.
See log for CodeGen/PhyRegAlloc.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6467 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 07:37:05 +00:00
Vikram S. Adve
d0d06ad4f3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6465 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-31 07:32:01 +00:00
Misha Brukman
88ba25444c When converting virtual registers to immediate constants, change the opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6452 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-30 20:36:27 +00:00
Misha Brukman
da3a8b19ce Added saveBBreferences() for BasicBlock resolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6451 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-30 20:32:45 +00:00
Guochun Shi
139f0c279d so far everything compiles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6423 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-30 00:17:09 +00:00
Misha Brukman
eae77de869 Correctly write out binary data as chars, before they're cast to ints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6385 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-28 18:27:19 +00:00
Misha Brukman
3432d1d1d5 Added a debugging code emitter that prints code to a file, debug to std::cerr,
and passes the real code to a memory-outputting code emitter. This may be
removed at a later point in development.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6379 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:43:19 +00:00
Vikram S. Adve
5f2180c533 (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".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6341 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 00:05:23 +00:00
Misha Brukman
6b77ec4156 Cleaned up code layout. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6304 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 21:49:18 +00:00
Misha Brukman
c2312df45c Kill `using' directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6301 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 21:24:35 +00:00
Chris Lattner
b52e0241c0 Use a kill, not a dead definition, update comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6131 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 17:37:30 +00:00
Chris Lattner
572c770668 * Keep LiveVariable information more up-to-date and consistent
* *** Finally mark values that are inputs to PHIs as killed when appropriate.
   This should make the generated code quite a bit better.  For example, the
   local-ra will not have to spill PHI inputs at the end of predecessor BB's
   anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6117 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 14:28:28 +00:00
Chris Lattner
a13f0d3f41 Fix bug where we could iterate off the end of a basic block
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6116 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 14:26:38 +00:00
Chris Lattner
fb2cb69dc5 * Keep the BBMap around as long as the pass is live
* Change getVarInfo to take real virtual register numbers and offset them
  itself.  This has caused me so much grief, it's not even funny.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6115 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 14:24:00 +00:00
Chris Lattner
98719d7cdc Fix N^2 algorithm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6112 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 04:08:54 +00:00
Chris Lattner
927ce5dfae * Fix several comments
* Update LiveVar info better, fixing bug: Jello/2003-05-11-PHIRegAllocBug.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6110 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 03:55:21 +00:00
Chris Lattner
d5725631c5 Fix tab infestation!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6109 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 03:54:14 +00:00
Chris Lattner
e0e72177c0 Allow const functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6056 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-09 03:27:41 +00:00
Chris Lattner
fd33fb8726 Add methods for stub function generation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6054 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 21:54:18 +00:00
Chris Lattner
5cdfbad72d Add a vector to keep track of which registers are allocatable. Remove FIXMEs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6015 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-07 20:08:36 +00:00
Chris Lattner
dff780f046 Re-add gross hack, it's still necessary. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6012 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-06 21:44:54 +00:00
Chris Lattner
82a4d207aa Remove hideously nasty hack
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6011 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-06 21:32:39 +00:00
Misha Brukman
15b55e20cc Debug output should go to cerr, not cout, because that's where bytecode goes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6002 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-04 22:51:30 +00:00
Chris Lattner
b589bf7d77 Fix a bug which occurred with empty basic blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5982 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-02 18:44:42 +00:00
Chris Lattner
f98358efc7 Minor cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5976 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-01 21:18:47 +00:00
Chris Lattner
2ee82e05e3 Remove unneccesary &*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5871 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 16:36:11 +00:00
Misha Brukman
63e04f3ccb Just some code beautification changes I had sitting around in my tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5859 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 23:00:08 +00:00
Misha Brukman
2c821cc06e Fixed compilation errors, command-line argument declarations, cleaned up code to
look nicer and removed useless stuff.

Also renamed a few variables, moved them into namespaces, converted outputting
to a file into a print to std::cerr with a DEBUG() guard, as all passes should
do anyway.

No functional changes have been made. However, this code now compiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5769 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-10 19:19:23 +00:00