aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2009-06-18 22:01:47 +0000
committerLang Hames <lhames@gmail.com>2009-06-18 22:01:47 +0000
commitcc6643230f348250657dba4e7667432aa4d16401 (patch)
tree88ab86e9ed520a7158d53b28e5cd77c5082b32bc /lib
parentb6d7fc3939b4a178ab90ea8ea9884e41ab6f419d (diff)
downloadexternal_llvm-cc6643230f348250657dba4e7667432aa4d16401.zip
external_llvm-cc6643230f348250657dba4e7667432aa4d16401.tar.gz
external_llvm-cc6643230f348250657dba4e7667432aa4d16401.tar.bz2
Improved PHI def marking, replaced some gotos with breaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73727 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index b67e39d..d4169db 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -584,7 +584,7 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,
// Replace the interval with one of a NEW value number. Note that this
// value number isn't actually defined by an instruction, weird huh? :)
- LiveRange LR(Start, End, interval.getNextValue(0, 0, false, VNInfoAllocator));
+ LiveRange LR(Start, End, interval.getNextValue(Start, 0, false, VNInfoAllocator));
LR.valno->setIsPHIDef(true);
DOUT << " replace range with " << LR;
interval.addRange(LR);
@@ -753,7 +753,7 @@ void LiveIntervals::handleLiveInRegister(MachineBasicBlock *MBB,
DOUT << " killed";
end = getUseIndex(baseIndex) + 1;
SeenDefUse = true;
- goto exit;
+ break;
} else if (mi->modifiesRegister(interval.reg, tri_)) {
// Another instruction redefines the register before it is ever read.
// Then the register is essentially dead at the instruction that defines
@@ -762,7 +762,7 @@ void LiveIntervals::handleLiveInRegister(MachineBasicBlock *MBB,
DOUT << " dead";
end = getDefIndex(start) + 1;
SeenDefUse = true;
- goto exit;
+ break;
}
baseIndex += InstrSlots::NUM;
@@ -774,7 +774,6 @@ void LiveIntervals::handleLiveInRegister(MachineBasicBlock *MBB,
}
}
-exit:
// Live-in register might not be used at all.
if (!SeenDefUse) {
if (isAlias) {
@@ -786,7 +785,10 @@ exit:
}
}
- LiveRange LR(start, end, interval.getNextValue(0, 0, false, VNInfoAllocator));
+ VNInfo *vni = interval.getNextValue(start, 0, false, VNInfoAllocator);
+ vni->setIsPHIDef(true);
+ LiveRange LR(start, end, vni);
+
interval.addRange(LR);
interval.addKill(LR.valno, end);
DOUT << " +" << LR << '\n';