Commit Graph

157 Commits

Author SHA1 Message Date
Chris Lattner
9670eecf33 Fix #includes of i*.h => Instructions.h as per PR403:
http://llvm.cs.uiuc.edu/PR403 .


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15331 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 17:11:37 +00:00
Brian Gaeke
a308f80155 Get rid of calls to void llvm::printSet(const ValueSet &).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15322 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 06:43:09 +00:00
Brian Gaeke
c998981505 TargetInstrInfo::getNOPOpCode() has been replaced by a reference to V9::NOP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15279 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:43:24 +00:00
Reid Spencer
518310cb0d bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14953 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:44:37 +00:00
Chris Lattner
4d143ee019 IA64 compat
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14867 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 00:08:28 +00:00
Reid Spencer
954da37bb4 Add #include <iostream> since Value.h does not #include it any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14622 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 12:19:56 +00:00
Brian Gaeke
498231bc60 Collapse together the abstract superclass TargetRegInfo and SparcV9RegInfo, its
only concrete implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13977 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-03 02:45:09 +00:00
Chris Lattner
d029cd2d5a Convert to the new TargetMachine interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13952 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-02 05:55:25 +00:00
Brian Gaeke
25d4b54f93 Reduce the amount of LLVM Values for which we save reg. allocator
state. Also, save the state for the incoming register of each phi
node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13906 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-30 07:08:43 +00:00
Brian Gaeke
a7afac29d0 Rename verifySavedState to dumpSavedState. Give it a new comment.
Call it at a more appropriate point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13905 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-30 04:22:24 +00:00
Chris Lattner
6ffe551f65 Changes to fix up the inst_iterator to pass to boost iterator checks. This
patch was graciously contributed by Vladimir Prus.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13185 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-27 15:13:33 +00:00
Chris Lattner
b4186e0ccd MBB::remove should not modify the iterator passed in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12572 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 21:59:59 +00:00
Brian Gaeke
eb8863db90 Don't warn about a null live range if the Value is a ConstantIntegral.
Otherwise, if you're in debugging mode, you get warnings for (apparently)
every immediate constant in the function during reg. allocation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12538 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 21:58:41 +00:00
Brian Gaeke
c760d647c6 Get rid of the abort in PhyRegAlloc::finishSavingState().
Make an explicit call to it from runOnFunction() if we know we're supposed to
write into the global. This is lame (esp. the const_cast), but it solves
the problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12291 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-11 19:46:30 +00:00
Brian Gaeke
cf68bd5fc1 In PhyRegAlloc::saveState(), dump Arguments' saved-state, and try to
make the output more compact.

Divorce state-saving from the doFinalization method; for some reason it's not
getting called when I want it to, at Reoptimizer time. Put the guts in
PhyRegAlloc::finishSavingState(). Put an abort() in it so that I can be really
really sure that it's getting called.

Update comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12286 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-11 06:45:52 +00:00
Brian Gaeke
d1b3679214 Move all the SaveState options and stuff inton one spot at the top of the file.
De-constify SaveStateToModule; we have to set both it and SaveRegAllocState
explicitly in the reoptimizer.
Make SaveRegAllocState an 'external location' option.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12278 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-10 22:21:03 +00:00
Brian Gaeke
14068d9f97 Only call verifySavedState if SaveRegAllocState is set AND debugging flag is on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12277 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-10 22:01:59 +00:00
Brian Gaeke
54a76b8808 Save argument list alloc state by recording it as the operands of Instruction
#-1. Other minor changes to deal with AllocInfo.Instruction becoming an int.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12246 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 23:22:02 +00:00
Chris Lattner
08d4963d49 Move the private MachineInstrAnnot.h into a private directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12003 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-29 19:12:51 +00:00
Brian Gaeke
748fba141f FunctionLiveVarInfo.h moved: include/llvm/CodeGen -> lib/Target/Sparc/LiveVar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11804 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-24 19:46:00 +00:00
Alkis Evlogimenos
f81af21caf Use newly added next() and prior() utility functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11430 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-14 01:18:34 +00:00
Alkis Evlogimenos
be766c7246 Remove getAllocatedRegNum(). Use getReg() instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11393 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-13 21:01:20 +00:00
Brian Gaeke
17247c64f2 Remove this MachineOpCodeFlags assertion - its test can never be false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11342 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-12 04:01:07 +00:00
Alkis Evlogimenos
c0b9dc5be7 Change MachineBasicBlock's vector of MachineInstr pointers into an
ilist of MachineInstr objects. This allows constant time removal and
insertion of MachineInstr instances from anywhere in each
MachineBasicBlock. It also allows for constant time splicing of
MachineInstrs into or out of MachineBasicBlocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11340 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-12 02:27:10 +00:00
Brian Gaeke
12c1d2c25a MachineInstr::getOpCode() --> getOpcode() in SPARC back-end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11335 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-11 20:47:34 +00:00
Brian Gaeke
97374d40d0 Add a new (static inline) std::ostream& << AllocInfo& method. Use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11002 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 19:05:43 +00:00
Alkis Evlogimenos
4d7af65903 Change interface of MachineOperand as follows:
a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
    b) add isUse(), isDef()
    c) rename opHiBits32() to isHiBits32(),
              opLoBits32() to isLoBits32(),
              opHiBits64() to isHiBits64(),
              opLoBits64() to isLoBits64().

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10461 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 13:24:17 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
Brian Gaeke
e9414cab00 Fix problems linking against the reoptimizer; _llvm_regAllocState must have
externally-visible linkage, and SaveStateToModule must default to true for llc.
I don't remember why I made it const; perhaps it should be deconstified.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9858 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-10 07:12:01 +00:00
Brian Gaeke
213904133d Operand numbers are now ints. Save the register allocation of the value
each instruction produces as "operand" -1, and the other operands as 0
.. n, as before. PhyRegAlloc::saveState() is refactored into
PhyRegAlloc::saveStateForValue().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9842 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-10 00:05:26 +00:00
Brian Gaeke
55766e139a Update verifySavedState()'s comment, so that it reflects its current
status.  In doFinalization(), skip over external functions, just like
Anand's mapping info does.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9703 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-04 22:42:41 +00:00
Brian Gaeke
cce4e7a1b1 Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9697 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-04 18:25:56 +00:00
Brian Gaeke
3ceac85296 Include llvm/CodeGen/MachineCodeForInstruction.h. Use it to start
implementing verifySavedState().

In saveState(), use the new AllocInfo::AllocStateTy enum, and increment
Insn each time through the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9617 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-30 21:21:33 +00:00
Brian Gaeke
8fc493430c Publicize the type of FnAllocState.
Prototype option to save state in a global instead of as a Constant in
 the Module. (Turned off, for now, with the on/off switch welded in the off
 position. You get the idea.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9500 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-24 21:21:58 +00:00
Brian Gaeke
537132bf12 Move AllocInfo structure to a private AllocInfo.h header file.
Make FnAllocState contain vectors of AllocInfo, instead of LLVM Constants.
Give doFinalization a method comment, and let it do the work of converting
 AllocInfos to LLVM Constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9451 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 20:32:55 +00:00
Misha Brukman
396c8c34ed * Fix order of #include files
* Doxygen-ify method comments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9432 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 18:06:27 +00:00
Brian Gaeke
60a3c55c4f Don't worry about converting each function's reg. alloc. state into One Big
Constant early on, because we can do it in doFinalization.

Tighten up a comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9387 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 20:44:23 +00:00
Brian Gaeke
af84370908 Doxygenify method comments.
Try to improve method comments a little.
Get rid of some excess whitespace; put braces on previous line when possible.
Add stub for method to verify the work of saveState().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9385 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 20:22:53 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +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
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
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
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
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
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