mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-24 05:09:34 +00:00
Now that MachineFunction/MachineBasicBlock keep a mapping of blocks to ID #'s
use them instead of a local LiveVariables numbering git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14523 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
61e4cb3605
commit
8490f9c92e
@ -292,7 +292,7 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock* mbb,
|
|||||||
if (interval.empty()) {
|
if (interval.empty()) {
|
||||||
for (unsigned i = 0, e = vi.AliveBlocks.size(); i != e; ++i) {
|
for (unsigned i = 0, e = vi.AliveBlocks.size(); i != e; ++i) {
|
||||||
if (vi.AliveBlocks[i]) {
|
if (vi.AliveBlocks[i]) {
|
||||||
MachineBasicBlock* mbb = lv_->getIndexMachineBasicBlock(i);
|
MachineBasicBlock* mbb = mf_->getBlockNumbered(i);
|
||||||
if (!mbb->empty()) {
|
if (!mbb->empty()) {
|
||||||
interval.addRange(
|
interval.addRange(
|
||||||
getInstructionIndex(&mbb->front()),
|
getInstructionIndex(&mbb->front()),
|
||||||
|
@ -37,22 +37,6 @@ using namespace llvm;
|
|||||||
|
|
||||||
static RegisterAnalysis<LiveVariables> X("livevars", "Live Variable Analysis");
|
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) {
|
LiveVariables::VarInfo &LiveVariables::getVarInfo(unsigned RegIdx) {
|
||||||
assert(MRegisterInfo::isVirtualRegister(RegIdx) &&
|
assert(MRegisterInfo::isVirtualRegister(RegIdx) &&
|
||||||
"getVarInfo: not a virtual register!");
|
"getVarInfo: not a virtual register!");
|
||||||
@ -177,10 +161,6 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
AllocatablePhysicalRegisters[*I] = true; // The reg is allocatable!
|
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
|
// PhysRegInfo - Keep track of which instruction was the last use of a
|
||||||
// physical register. This is a purely local property, because all physical
|
// physical register. This is a purely local property, because all physical
|
||||||
// register references as presumed dead across basic blocks.
|
// register references as presumed dead across basic blocks.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user