forked from OSchip/llvm-project
Live intervals for live-in registers should begin at the beginning of a basic block, not at the first
instruction. Also, their valno's should have an unknown def. This has no effect currently, but was causing issues when StrongPHIElimination was enabled. llvm-svn: 56231
This commit is contained in:
parent
68e7735a38
commit
82ab1e7280
|
@ -624,7 +624,11 @@ void LiveIntervals::handleLiveInRegister(MachineBasicBlock *MBB,
|
||||||
MachineBasicBlock::iterator mi = MBB->begin();
|
MachineBasicBlock::iterator mi = MBB->begin();
|
||||||
unsigned baseIndex = MIIdx;
|
unsigned baseIndex = MIIdx;
|
||||||
unsigned start = baseIndex;
|
unsigned start = baseIndex;
|
||||||
unsigned end = start;
|
while (baseIndex / InstrSlots::NUM < i2miMap_.size() &&
|
||||||
|
getInstructionFromIndex(baseIndex) == 0)
|
||||||
|
baseIndex += InstrSlots::NUM;
|
||||||
|
unsigned end = baseIndex;
|
||||||
|
|
||||||
while (mi != MBB->end()) {
|
while (mi != MBB->end()) {
|
||||||
if (mi->killsRegister(interval.reg, tri_)) {
|
if (mi->killsRegister(interval.reg, tri_)) {
|
||||||
DOUT << " killed";
|
DOUT << " killed";
|
||||||
|
@ -659,7 +663,7 @@ exit:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LiveRange LR(start, end, interval.getNextValue(start, 0, VNInfoAllocator));
|
LiveRange LR(start, end, interval.getNextValue(~0U, 0, VNInfoAllocator));
|
||||||
interval.addRange(LR);
|
interval.addRange(LR);
|
||||||
interval.addKill(LR.valno, end);
|
interval.addKill(LR.valno, end);
|
||||||
DOUT << " +" << LR << '\n';
|
DOUT << " +" << LR << '\n';
|
||||||
|
@ -676,11 +680,6 @@ void LiveIntervals::computeIntervals() {
|
||||||
// Track the index of the current machine instr.
|
// Track the index of the current machine instr.
|
||||||
unsigned MIIndex = 0;
|
unsigned MIIndex = 0;
|
||||||
|
|
||||||
// Skip over empty initial indices.
|
|
||||||
while (MIIndex / InstrSlots::NUM < i2miMap_.size() &&
|
|
||||||
getInstructionFromIndex(MIIndex) == 0)
|
|
||||||
MIIndex += InstrSlots::NUM;
|
|
||||||
|
|
||||||
for (MachineFunction::iterator MBBI = mf_->begin(), E = mf_->end();
|
for (MachineFunction::iterator MBBI = mf_->begin(), E = mf_->end();
|
||||||
MBBI != E; ++MBBI) {
|
MBBI != E; ++MBBI) {
|
||||||
MachineBasicBlock *MBB = MBBI;
|
MachineBasicBlock *MBB = MBBI;
|
||||||
|
@ -699,6 +698,11 @@ void LiveIntervals::computeIntervals() {
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip over empty initial indices.
|
||||||
|
while (MIIndex / InstrSlots::NUM < i2miMap_.size() &&
|
||||||
|
getInstructionFromIndex(MIIndex) == 0)
|
||||||
|
MIIndex += InstrSlots::NUM;
|
||||||
|
|
||||||
for (; MI != miEnd; ++MI) {
|
for (; MI != miEnd; ++MI) {
|
||||||
DOUT << MIIndex << "\t" << *MI;
|
DOUT << MIIndex << "\t" << *MI;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue