[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervals.cpp PHIElimination.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat May 1 16:25:03 PDT 2004
Changes in directory llvm/lib/CodeGen:
LiveIntervals.cpp updated: 1.70 -> 1.71
PHIElimination.cpp updated: 1.21 -> 1.22
---
Log message:
Operate on the Machine CFG instead of on the LLVM CFG
---
Diffs of the changes: (+12 -17)
Index: llvm/lib/CodeGen/LiveIntervals.cpp
diff -u llvm/lib/CodeGen/LiveIntervals.cpp:1.70 llvm/lib/CodeGen/LiveIntervals.cpp:1.71
--- llvm/lib/CodeGen/LiveIntervals.cpp:1.70 Mon Apr 12 15:26:39 2004
+++ llvm/lib/CodeGen/LiveIntervals.cpp Sat May 1 16:24:39 2004
@@ -17,6 +17,7 @@
#define DEBUG_TYPE "liveintervals"
#include "LiveIntervals.h"
+#include "llvm/Value.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
@@ -26,7 +27,6 @@
#include "llvm/Target/MRegisterInfo.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/CFG.h"
#include "Support/CommandLine.h"
#include "Support/Debug.h"
#include "Support/Statistic.h"
@@ -97,10 +97,9 @@
unsigned miIndex = 0;
for (MachineFunction::iterator mbb = mf_->begin(), mbbEnd = mf_->end();
mbb != mbbEnd; ++mbb) {
- const std::pair<MachineBasicBlock*, unsigned>& entry =
- lv_->getMachineBasicBlockInfo(mbb);
- bool inserted = mbbi2mbbMap_.insert(std::make_pair(entry.second,
- entry.first)).second;
+ unsigned mbbIdx = lv_->getMachineBasicBlockIndex(mbb);
+ bool inserted = mbbi2mbbMap_.insert(std::make_pair(mbbIdx,
+ mbb)).second;
assert(inserted && "multiple index -> MachineBasicBlock");
for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end();
@@ -182,7 +181,7 @@
DEBUG(
for (MachineFunction::iterator mbbi = mf_->begin(), mbbe = mf_->end();
mbbi != mbbe; ++mbbi) {
- std::cerr << mbbi->getBasicBlock()->getName() << ":\n";
+ std::cerr << ((Value*)mbbi->getBasicBlock())->getName() << ":\n";
for (MachineBasicBlock::iterator mii = mbbi->begin(),
mie = mbbi->end(); mii != mie; ++mii) {
std::cerr << getInstructionIndex(mii) << '\t';
@@ -404,13 +403,13 @@
{
DEBUG(std::cerr << "********** COMPUTING LIVE INTERVALS **********\n");
DEBUG(std::cerr << "********** Function: "
- << mf_->getFunction()->getName() << '\n');
+ << ((Value*)mf_->getFunction())->getName() << '\n');
for (MbbIndex2MbbMap::iterator
it = mbbi2mbbMap_.begin(), itEnd = mbbi2mbbMap_.end();
it != itEnd; ++it) {
MachineBasicBlock* mbb = it->second;
- DEBUG(std::cerr << mbb->getBasicBlock()->getName() << ":\n");
+ DEBUG(std::cerr << ((Value*)mbb->getBasicBlock())->getName() << ":\n");
for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end();
mi != miEnd; ++mi) {
@@ -451,7 +450,7 @@
for (MachineFunction::iterator mbbi = mf_->begin(), mbbe = mf_->end();
mbbi != mbbe; ++mbbi) {
MachineBasicBlock* mbb = mbbi;
- DEBUG(std::cerr << mbb->getBasicBlock()->getName() << ":\n");
+ DEBUG(std::cerr << ((Value*)mbb->getBasicBlock())->getName() << ":\n");
for (MachineBasicBlock::iterator mi = mbb->begin(), mie = mbb->end();
mi != mie; ++mi) {
Index: llvm/lib/CodeGen/PHIElimination.cpp
diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.21 llvm/lib/CodeGen/PHIElimination.cpp:1.22
--- llvm/lib/CodeGen/PHIElimination.cpp:1.21 Wed Mar 31 15:59:29 2004
+++ llvm/lib/CodeGen/PHIElimination.cpp Sat May 1 16:24:39 2004
@@ -20,7 +20,6 @@
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/CFG.h"
#include "Support/STLExtras.h"
using namespace llvm;
@@ -195,14 +194,12 @@
// at an appropriate point later.
//
bool ValueIsLive = false;
- const BasicBlock *BB = opBlock.getBasicBlock();
- for (succ_const_iterator SI = succ_begin(BB), E = succ_end(BB);
- SI != E && !ValueIsLive; ++SI) {
- const std::pair<MachineBasicBlock*, unsigned> &
- SuccInfo = LV->getBasicBlockInfo(*SI);
+ for (MachineBasicBlock::succ_iterator SI = opBlock.succ_begin(),
+ E = opBlock.succ_end(); SI != E && !ValueIsLive; ++SI) {
+ MachineBasicBlock *MBB = *SI;
// Is it alive in this successor?
- unsigned SuccIdx = SuccInfo.second;
+ unsigned SuccIdx = LV->getMachineBasicBlockIndex(MBB);
if (SuccIdx < InRegVI.AliveBlocks.size() &&
InRegVI.AliveBlocks[SuccIdx]) {
ValueIsLive = true;
@@ -210,7 +207,6 @@
}
// Is it killed in this successor?
- MachineBasicBlock *MBB = SuccInfo.first;
for (unsigned i = 0, e = InRegVI.Kills.size(); i != e; ++i)
if (InRegVI.Kills[i].first == MBB) {
ValueIsLive = true;
More information about the llvm-commits
mailing list