mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-18 12:29:27 +00:00
Correctly mark a valno that was previous defined by a PHI node as having an
unknown defining inst after PHI elimination. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49069 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4316dec10e
commit
59df878391
@ -845,7 +845,6 @@ void StrongPHIElimination::mergeLiveIntervals(unsigned primary,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) {
|
bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) {
|
||||||
|
|
||||||
LiveIntervals& LI = getAnalysis<LiveIntervals>();
|
LiveIntervals& LI = getAnalysis<LiveIntervals>();
|
||||||
|
|
||||||
// Compute DFS numbers of each block
|
// Compute DFS numbers of each block
|
||||||
@ -889,15 +888,19 @@ bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) {
|
|||||||
|
|
||||||
// If this is a dead PHI node, then remove it from LiveIntervals.
|
// If this is a dead PHI node, then remove it from LiveIntervals.
|
||||||
unsigned DestReg = PInstr->getOperand(0).getReg();
|
unsigned DestReg = PInstr->getOperand(0).getReg();
|
||||||
if (PInstr->registerDefIsDead(DestReg)) {
|
|
||||||
LiveInterval& PI = LI.getInterval(DestReg);
|
LiveInterval& PI = LI.getInterval(DestReg);
|
||||||
|
if (PInstr->registerDefIsDead(DestReg)) {
|
||||||
if (PI.containsOneValue()) {
|
if (PI.containsOneValue()) {
|
||||||
LI.removeInterval(DestReg);
|
LI.removeInterval(DestReg);
|
||||||
} else {
|
} else {
|
||||||
unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr));
|
unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr));
|
||||||
PI.removeRange(*PI.getLiveRangeContaining(idx), true);
|
PI.removeRange(*PI.getLiveRangeContaining(idx), true);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// If the PHI is not dead, then the valno defined by the PHI
|
||||||
|
// now has an unknown def.
|
||||||
|
unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr));
|
||||||
|
PI.getLiveRangeContaining(idx)->valno->def = ~0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
LI.RemoveMachineInstrFromMaps(PInstr);
|
LI.RemoveMachineInstrFromMaps(PInstr);
|
||||||
|
Loading…
Reference in New Issue
Block a user