diff options
author | Owen Anderson <resistor@mac.com> | 2008-04-02 02:12:45 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-04-02 02:12:45 +0000 |
commit | 2d24f3cbecf3ef365c026eeb774f4b1a2a2f6bbc (patch) | |
tree | 1e099527cf32c22f71bf4fcad02f1e1442df1c3d /lib/CodeGen | |
parent | 10368b64f83a38438bac7d6ff67031b48468b68d (diff) | |
download | external_llvm-2d24f3cbecf3ef365c026eeb774f4b1a2a2f6bbc.zip external_llvm-2d24f3cbecf3ef365c026eeb774f4b1a2a2f6bbc.tar.gz external_llvm-2d24f3cbecf3ef365c026eeb774f4b1a2a2f6bbc.tar.bz2 |
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
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/StrongPHIElimination.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/CodeGen/StrongPHIElimination.cpp b/lib/CodeGen/StrongPHIElimination.cpp index f89d9f2..6416690 100644 --- a/lib/CodeGen/StrongPHIElimination.cpp +++ b/lib/CodeGen/StrongPHIElimination.cpp @@ -845,7 +845,6 @@ void StrongPHIElimination::mergeLiveIntervals(unsigned primary, } bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) { - LiveIntervals& LI = getAnalysis<LiveIntervals>(); // Compute DFS numbers of each block @@ -889,17 +888,21 @@ bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) { // If this is a dead PHI node, then remove it from LiveIntervals. unsigned DestReg = PInstr->getOperand(0).getReg(); + LiveInterval& PI = LI.getInterval(DestReg); if (PInstr->registerDefIsDead(DestReg)) { - LiveInterval& PI = LI.getInterval(DestReg); - if (PI.containsOneValue()) { LI.removeInterval(DestReg); } else { unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr)); 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); PInstr->eraseFromParent(); } |