summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-02-04 05:41:20 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-02-04 05:41:20 +0000
commite38657812162a393db3e31bef3d8632cfa988410 (patch)
treea65de6af8ed8f05718410e2ab1ca35234ea07b6a /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parentbcc9bcb65fe28af2ca256af21b34aed76c357097 (diff)
downloadbcm5719-llvm-e38657812162a393db3e31bef3d8632cfa988410.tar.gz
bcm5719-llvm-e38657812162a393db3e31bef3d8632cfa988410.zip
Correctly terminate a physreg redefined by an early clobber.
I don't have a test that fails because of this, but a test case like CodeGen/X86/2009-12-01-EarlyClobberBug.ll exposes the problem. EAX is redefined by a tied early clobber operand on inline asm, and the live range should look like this: %EAX,inf = [48r,64e:0)[64e,80r:1) 0@48r 1@64e Previously, the two values got merged: %EAX,inf = [48r,80r:0) 0@48r With this bug fixed, the REDEF_BY_EC VNInfo flag is no longer needed. llvm-svn: 149768
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index e268819897c..d72009ccd22 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -402,7 +402,7 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock *MBB,
if (DefIdx != -1) {
if (mi->isRegTiedToUseOperand(DefIdx)) {
// Two-address instruction.
- end = baseIndex.getRegSlot();
+ end = baseIndex.getRegSlot(mi->getOperand(DefIdx).isEarlyClobber());
} else {
// Another instruction redefines the register before it is ever read.
// Then the register is essentially dead at the instruction that
OpenPOWER on IntegriCloud