aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/SparcV9/RegAlloc
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-03-08 23:22:02 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-03-08 23:22:02 +0000
commit54a76b880858bc2b6abd1357a5694e16e7794315 (patch)
treed64413001b68246b294d9a2dd932b746a3c5bd50 /lib/Target/SparcV9/RegAlloc
parent757ccd5149eb804b3b87979be049263f3070c4d8 (diff)
downloadexternal_llvm-54a76b880858bc2b6abd1357a5694e16e7794315.zip
external_llvm-54a76b880858bc2b6abd1357a5694e16e7794315.tar.gz
external_llvm-54a76b880858bc2b6abd1357a5694e16e7794315.tar.bz2
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
Diffstat (limited to 'lib/Target/SparcV9/RegAlloc')
-rw-r--r--lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
index c0b52d4..7c30ca9 100644
--- a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
+++ b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
@@ -1125,7 +1125,7 @@ void PhyRegAlloc::allocateStackSpace4SpilledLRs() {
void PhyRegAlloc::saveStateForValue (std::vector<AllocInfo> &state,
- const Value *V, unsigned Insn, int Opnd) {
+ const Value *V, int Insn, int Opnd) {
LiveRangeMapType::const_iterator HMI = LRI->getLiveRangeMap ()->find (V);
LiveRangeMapType::const_iterator HMIEnd = LRI->getLiveRangeMap ()->end ();
AllocInfo::AllocStateTy AllocState = AllocInfo::NotAllocated;
@@ -1155,7 +1155,15 @@ void PhyRegAlloc::saveStateForValue (std::vector<AllocInfo> &state,
///
void PhyRegAlloc::saveState () {
std::vector<AllocInfo> &state = FnAllocState[Fn];
+ unsigned ArgNum = 0;
+ // Arguments encoded as instruction # -1
+ for (Function::const_aiterator i=Fn->abegin (), e=Fn->aend (); i != e; ++i) {
+ const Argument *Arg = &*i;
+ saveStateForValue (state, Arg, -1, ArgNum);
+ ++ArgNum;
+ }
unsigned Insn = 0;
+ // Instructions themselves encoded as operand # -1
for (const_inst_iterator II=inst_begin (Fn), IE=inst_end (Fn); II!=IE; ++II){
saveStateForValue (state, (*II), Insn, -1);
for (unsigned i = 0; i < (*II)->getNumOperands (); ++i) {
@@ -1176,7 +1184,7 @@ void PhyRegAlloc::saveState () {
///
void PhyRegAlloc::verifySavedState () {
std::vector<AllocInfo> &state = FnAllocState[Fn];
- unsigned Insn = 0;
+ int Insn = 0;
for (const_inst_iterator II=inst_begin (Fn), IE=inst_end (Fn); II!=IE; ++II) {
const Instruction *I = *II;
MachineCodeForInstruction &Instrs = MachineCodeForInstruction::get (I);