summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-02-13 09:06:18 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-02-13 09:06:18 +0000
commitbb4b97f90ead6b495ecff9af2c69602baca58dcc (patch)
treeee998f11471a53216ceeec1c38bce2217ac38034 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parent8cc58728a8e662b3c1d1480dd939928ee00365a1 (diff)
downloadbcm5719-llvm-bb4b97f90ead6b495ecff9af2c69602baca58dcc.tar.gz
bcm5719-llvm-bb4b97f90ead6b495ecff9af2c69602baca58dcc.zip
Fix a potential serious problem where kills belonging to the val# defined by a two-address instruction is also on the val# that defines the input.
llvm-svn: 47057
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index 43a092a4df2..d32fc623795 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -315,7 +315,6 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,
const LiveRange *OldLR = interval.getLiveRangeContaining(RedefIndex-1);
VNInfo *OldValNo = OldLR->valno;
- unsigned OldEnd = OldLR->end;
// Delete the initial value, which should be short and continuous,
// because the 2-addr copy must be in the same MBB as the redef.
@@ -328,7 +327,8 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,
// The new value number (#1) is defined by the instruction we claimed
// defined value #0.
VNInfo *ValNo = interval.getNextValue(0, 0, VNInfoAllocator);
- interval.copyValNumInfo(ValNo, OldValNo);
+ ValNo->def = OldValNo->def;
+ ValNo->reg = OldValNo->reg;
// Value#0 is now defined by the 2-addr instruction.
OldValNo->def = RedefIndex;
@@ -339,7 +339,6 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,
DOUT << " replace range with " << LR;
interval.addRange(LR);
interval.addKill(ValNo, RedefIndex);
- interval.removeKills(ValNo, RedefIndex, OldEnd);
// If this redefinition is dead, we need to add a dummy unit live
// range covering the def slot.
OpenPOWER on IntegriCloud