[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervals.cpp LiveVariables.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Jul 1 01:16:01 PDT 2004
Changes in directory llvm/lib/CodeGen:
LiveIntervals.cpp updated: 1.82 -> 1.83
LiveVariables.cpp updated: 1.35 -> 1.36
---
Log message:
Now that MachineFunction/MachineBasicBlock keep a mapping of blocks to ID #'s
use them instead of a local LiveVariables numbering
---
Diffs of the changes: (+1 -21)
Index: llvm/lib/CodeGen/LiveIntervals.cpp
diff -u llvm/lib/CodeGen/LiveIntervals.cpp:1.82 llvm/lib/CodeGen/LiveIntervals.cpp:1.83
--- llvm/lib/CodeGen/LiveIntervals.cpp:1.82 Wed Jun 30 23:29:47 2004
+++ llvm/lib/CodeGen/LiveIntervals.cpp Thu Jul 1 01:15:32 2004
@@ -292,7 +292,7 @@
if (interval.empty()) {
for (unsigned i = 0, e = vi.AliveBlocks.size(); i != e; ++i) {
if (vi.AliveBlocks[i]) {
- MachineBasicBlock* mbb = lv_->getIndexMachineBasicBlock(i);
+ MachineBasicBlock* mbb = mf_->getBlockNumbered(i);
if (!mbb->empty()) {
interval.addRange(
getInstructionIndex(&mbb->front()),
Index: llvm/lib/CodeGen/LiveVariables.cpp
diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.35 llvm/lib/CodeGen/LiveVariables.cpp:1.36
--- llvm/lib/CodeGen/LiveVariables.cpp:1.35 Wed Jun 30 23:29:47 2004
+++ llvm/lib/CodeGen/LiveVariables.cpp Thu Jul 1 01:15:32 2004
@@ -37,22 +37,6 @@
static RegisterAnalysis<LiveVariables> X("livevars", "Live Variable Analysis");
-/// getIndexMachineBasicBlock() - Given a block index, return the
-/// MachineBasicBlock corresponding to it.
-MachineBasicBlock *LiveVariables::getIndexMachineBasicBlock(unsigned Idx) {
- if (BBIdxMap.empty()) {
- BBIdxMap.resize(BBMap.size());
- for (std::map<MachineBasicBlock*, unsigned>::iterator I = BBMap.begin(),
- E = BBMap.end(); I != E; ++I) {
- assert(BBIdxMap.size() > I->second && "Indices are not sequential");
- assert(BBIdxMap[I->second] == 0 && "Multiple idx collision!");
- BBIdxMap[I->second] = I->first;
- }
- }
- assert(Idx < BBIdxMap.size() && "BB Index out of range!");
- return BBIdxMap[Idx];
-}
-
LiveVariables::VarInfo &LiveVariables::getVarInfo(unsigned RegIdx) {
assert(MRegisterInfo::isVirtualRegister(RegIdx) &&
"getVarInfo: not a virtual register!");
@@ -177,10 +161,6 @@
AllocatablePhysicalRegisters[*I] = true; // The reg is allocatable!
}
- // Build BBMap...
- for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
- BBMap[I] = I->getNumber();
-
// PhysRegInfo - Keep track of which instruction was the last use of a
// physical register. This is a purely local property, because all physical
// register references as presumed dead across basic blocks.
More information about the llvm-commits
mailing list