diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-07-21 21:15:20 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-07-21 21:15:20 +0000 |
commit | cd4317efcf334be10d9a98008a1445d6e12a7712 (patch) | |
tree | 82f4e6381dbe6669926e797094654c0f430ed18c /lib/CodeGen/RegAllocLocal.cpp | |
parent | 60f09928a0d22d5927ff0a40fe9163cf1ba1014a (diff) |
Eliminate data relocations by using NULL instead of global empty list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29250 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocLocal.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index 97be06fe8e..763221ffbf 100644 --- a/lib/CodeGen/RegAllocLocal.cpp +++ b/lib/CodeGen/RegAllocLocal.cpp @@ -525,9 +525,11 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { // Loop over the implicit uses, making sure that they are at the head of the // use order list, so they don't get reallocated. - for (const unsigned *ImplicitUses = TID.ImplicitUses; - *ImplicitUses; ++ImplicitUses) - MarkPhysRegRecentlyUsed(*ImplicitUses); + if (TID.ImplicitUses) { + for (const unsigned *ImplicitUses = TID.ImplicitUses; + *ImplicitUses; ++ImplicitUses) + MarkPhysRegRecentlyUsed(*ImplicitUses); + } // Get the used operands into registers. This has the potential to spill // incoming values if we are out of registers. Note that we completely @@ -587,19 +589,21 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { } // Loop over the implicit defs, spilling them as well. - for (const unsigned *ImplicitDefs = TID.ImplicitDefs; - *ImplicitDefs; ++ImplicitDefs) { - unsigned Reg = *ImplicitDefs; - spillPhysReg(MBB, MI, Reg, true); - PhysRegsUseOrder.push_back(Reg); - PhysRegsUsed[Reg] = 0; // It is free and reserved now - PhysRegsEverUsed[Reg] = true; + if (TID.ImplicitDefs) { + for (const unsigned *ImplicitDefs = TID.ImplicitDefs; + *ImplicitDefs; ++ImplicitDefs) { + unsigned Reg = *ImplicitDefs; + spillPhysReg(MBB, MI, Reg, true); + PhysRegsUseOrder.push_back(Reg); + PhysRegsUsed[Reg] = 0; // It is free and reserved now + PhysRegsEverUsed[Reg] = true; - for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg); - *AliasSet; ++AliasSet) { - PhysRegsUseOrder.push_back(*AliasSet); - PhysRegsUsed[*AliasSet] = 0; // It is free and reserved now - PhysRegsEverUsed[*AliasSet] = true; + for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg); + *AliasSet; ++AliasSet) { + PhysRegsUseOrder.push_back(*AliasSet); + PhysRegsUsed[*AliasSet] = 0; // It is free and reserved now + PhysRegsEverUsed[*AliasSet] = true; + } } } |