diff options
author | Owen Anderson <resistor@mac.com> | 2007-11-08 01:20:48 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-11-08 01:20:48 +0000 |
commit | 9d86ef12c8a59e27c7b2ace67f5a11a06d0191f2 (patch) | |
tree | abb7d87560f9226120fc616b09984ca1484354a0 /llvm/lib/CodeGen/LiveVariables.cpp | |
parent | a34b0577629e3a63bc018fa6da903d2617ef71d7 (diff) | |
download | bcm5719-llvm-9d86ef12c8a59e27c7b2ace67f5a11a06d0191f2.tar.gz bcm5719-llvm-9d86ef12c8a59e27c7b2ace67f5a11a06d0191f2.zip |
Bring UsedBlocks back. StrongPHIElimination needs this information.
llvm-svn: 43866
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveVariables.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp index 7e8965ea840..2af8bf316e1 100644 --- a/llvm/lib/CodeGen/LiveVariables.cpp +++ b/llvm/lib/CodeGen/LiveVariables.cpp @@ -50,6 +50,9 @@ void LiveVariables::VarInfo::dump() const { cerr << " Alive in blocks: "; for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i) if (AliveBlocks[i]) cerr << i << ", "; + cerr << " Used in blocks: "; + for (unsigned i = 0, e = UsedBlocks.size(); i != e; ++i) + if (UsedBlocks[i]) cerr << i << ", "; cerr << "\n Killed by:"; if (Kills.empty()) cerr << " No instructions.\n"; @@ -72,6 +75,7 @@ LiveVariables::VarInfo &LiveVariables::getVarInfo(unsigned RegIdx) { } VarInfo &VI = VirtRegInfo[RegIdx]; VI.AliveBlocks.resize(MF->getNumBlockIDs()); + VI.UsedBlocks.resize(MF->getNumBlockIDs()); return VI; } @@ -154,6 +158,9 @@ void LiveVariables::HandleVirtRegUse(VarInfo &VRInfo, MachineBasicBlock *MBB, MachineInstr *MI) { assert(VRInfo.DefInst && "Register use before def!"); + unsigned BBNum = MBB->getNumber(); + + VRInfo.UsedBlocks[BBNum] = true; VRInfo.NumUses++; // Check to see if this basic block is already a kill block... @@ -176,7 +183,7 @@ void LiveVariables::HandleVirtRegUse(VarInfo &VRInfo, MachineBasicBlock *MBB, // If this virtual register is already marked as alive in this basic block, // that means it is alive in at least one of the successor block, it's not // a kill. - if (!VRInfo.AliveBlocks[MBB->getNumber()]) + if (!VRInfo.AliveBlocks[BBNum]) VRInfo.Kills.push_back(MI); // Update all dominating blocks to mark them known live. |