diff options
author | Chris Lattner <sabre@nondot.org> | 2002-06-25 16:13:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-06-25 16:13:24 +0000 |
commit | 7e70829632f82de15db187845666aaca6e04b792 (patch) | |
tree | 48dd2d804e7ebec9a3cbd8bf229cb2a2aa20dce5 /lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp | |
parent | 0b12b5f50ec77a8bd01b92d287c52d748619bb4b (diff) | |
download | external_llvm-7e70829632f82de15db187845666aaca6e04b792.tar.gz external_llvm-7e70829632f82de15db187845666aaca6e04b792.tar.bz2 external_llvm-7e70829632f82de15db187845666aaca6e04b792.zip |
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
Diffstat (limited to 'lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp')
-rw-r--r-- | lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp index 6661eca801..4bbd36f635 100644 --- a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp +++ b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp @@ -84,29 +84,20 @@ void LiveRangeInfo::constructLiveRanges() { // first find the live ranges for all incoming args of the function since // those LRs start from the start of the function - - // get the argument list - const Function::ArgumentListType& ArgList = Meth->getArgumentList(); - - Function::ArgumentListType::const_iterator ArgIt = ArgList.begin(); - for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument - LiveRange * ArgRange = new LiveRange(); // creates a new LR and - const Value *Val = (const Value *) *ArgIt; - - ArgRange->insert(Val); // add the arg (def) to it - LiveRangeMap[Val] = ArgRange; + for (Function::const_aiterator AI = Meth->abegin(); AI != Meth->aend(); ++AI){ + LiveRange *ArgRange = new LiveRange(); // creates a new LR and + ArgRange->insert(AI); // add the arg (def) to it + LiveRangeMap[AI] = ArgRange; // create a temp machine op to find the register class of value //const MachineOperand Op(MachineOperand::MO_VirtualRegister); - unsigned rcid = MRI.getRegClassIDOfValue( Val ); - ArgRange->setRegClass(RegClassList[ rcid ] ); + unsigned rcid = MRI.getRegClassIDOfValue(AI); + ArgRange->setRegClass(RegClassList[rcid]); - if( DEBUG_RA > 1) { - cerr << " adding LiveRange for argument " - << RAV((const Value *)*ArgIt) << "\n"; - } + if( DEBUG_RA > 1) + cerr << " adding LiveRange for argument " << RAV(AI) << "\n"; } // Now suggest hardware registers for these function args @@ -123,7 +114,7 @@ void LiveRangeInfo::constructLiveRanges() { // the same Value in machine instructions. // get the iterator for machine instructions - const MachineCodeForBasicBlock& MIVec = (*BBI)->getMachineInstrVec(); + const MachineCodeForBasicBlock& MIVec = BBI->getMachineInstrVec(); // iterate over all the machine instructions in BB for(MachineCodeForBasicBlock::const_iterator MInstIterator = MIVec.begin(); @@ -275,7 +266,7 @@ void LiveRangeInfo::coalesceLRs() BBI != BBE; ++BBI) { // get the iterator for machine instructions - const MachineCodeForBasicBlock& MIVec = (*BBI)->getMachineInstrVec(); + const MachineCodeForBasicBlock& MIVec = BBI->getMachineInstrVec(); MachineCodeForBasicBlock::const_iterator MInstIterator = MIVec.begin(); // iterate over all the machine instructions in BB |