X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FRegAllocBigBlock.cpp;h=215f9430997ea6ef137307153f2dba495a3cdbee;hb=5ac319ac7125b009adddcc49294d2e040c4a91e5;hp=f2c45ec9162cb2e979d4ad4ef71444d80946b6e7;hpb=6f0d024a534af18d9e60b3ea757376cd8a3a980e;p=oota-llvm.git diff --git a/lib/CodeGen/RegAllocBigBlock.cpp b/lib/CodeGen/RegAllocBigBlock.cpp index f2c45ec9162..215f9430997 100644 --- a/lib/CodeGen/RegAllocBigBlock.cpp +++ b/lib/CodeGen/RegAllocBigBlock.cpp @@ -44,7 +44,6 @@ #include "llvm/ADT/IndexedMap.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/Statistic.h" #include using namespace llvm; @@ -53,11 +52,11 @@ STATISTIC(NumStores, "Number of stores added"); STATISTIC(NumLoads , "Number of loads added"); STATISTIC(NumFolded, "Number of loads/stores folded into instructions"); -namespace { - static RegisterRegAlloc - bigBlockRegAlloc("bigblock", " Big-block register allocator", - createBigBlockRegisterAllocator); +static RegisterRegAlloc + bigBlockRegAlloc("bigblock", " Big-block register allocator", + createBigBlockRegisterAllocator); +namespace { /// VRegKeyInfo - Defines magic values required to use VirtRegs as DenseMap /// keys. struct VRegKeyInfo { @@ -386,7 +385,7 @@ bool RABigBlock::isPhysRegAvailable(unsigned PhysReg) const { // not free! for (const unsigned *AliasSet = RegInfo->getAliasSet(PhysReg); *AliasSet; ++AliasSet) - if (PhysRegsUsed[*AliasSet] != -1) // Aliased register in use? + if (PhysRegsUsed[*AliasSet] >= 0) // Aliased register in use? return false; // Can't use this reg then. return true; } @@ -696,7 +695,7 @@ void RABigBlock::AllocateBasicBlock(MachineBasicBlock &MBB) { // Unallocatable register dead, ignore. continue; } else { - assert(!PhysRegsUsed[PhysReg] || PhysRegsUsed[PhysReg] == -1 && + assert((!PhysRegsUsed[PhysReg] || PhysRegsUsed[PhysReg] == -1) && "Silently clearing a virtual register?"); } @@ -833,11 +832,12 @@ void RABigBlock::AllocateBasicBlock(MachineBasicBlock &MBB) { // Spill all physical registers holding virtual registers now. for (unsigned i = 0, e = RegInfo->getNumRegs(); i != e; ++i) - if (PhysRegsUsed[i] != -1 && PhysRegsUsed[i] != -2) + if (PhysRegsUsed[i] != -1 && PhysRegsUsed[i] != -2) { if (unsigned VirtReg = PhysRegsUsed[i]) spillVirtReg(MBB, MI, VirtReg, i); else removePhysReg(i); + } } /// runOnMachineFunction - Register allocate the whole function