summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineVerifier.cpp
diff options
context:
space:
mode:
authorPedro Artigas <partigas@apple.com>2013-11-08 22:46:28 +0000
committerPedro Artigas <partigas@apple.com>2013-11-08 22:46:28 +0000
commitd900b1179535298510490030a5d2ecce93f79eb0 (patch)
tree318d810b7d16b194f189a817a707ef245f3ac05d /lib/CodeGen/MachineVerifier.cpp
parentdc7eb3e023e34adc9d40e93626467cfe22756f4c (diff)
downloadllvm-d900b1179535298510490030a5d2ecce93f79eb0.tar.gz
llvm-d900b1179535298510490030a5d2ecce93f79eb0.tar.bz2
llvm-d900b1179535298510490030a5d2ecce93f79eb0.tar.xz
increase the accuracy of register pressure computation in the presence of dead definitions by using live intervals, if available, to identify dead definitions and proceed accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineVerifier.cpp')
-rw-r--r--lib/CodeGen/MachineVerifier.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/CodeGen/MachineVerifier.cpp b/lib/CodeGen/MachineVerifier.cpp
index df4568359a..c57ce9c65c 100644
--- a/lib/CodeGen/MachineVerifier.cpp
+++ b/lib/CodeGen/MachineVerifier.cpp
@@ -1096,6 +1096,14 @@ void MachineVerifier::checkLiveness(const MachineOperand *MO, unsigned MONum) {
report("No live segment at def", MO, MONum);
*OS << DefIdx << " is not live in " << LI << '\n';
}
+ // Check that, if the dead def flag is present, LiveInts agree.
+ if (MO->isDead()) {
+ LiveQueryResult LRQ = LI.Query(DefIdx);
+ if (!LRQ.isDeadDef()) {
+ report("Live range continues after dead def flag", MO, MONum);
+ *OS << "Live range: " << LI << '\n';
+ }
+ }
} else {
report("Virtual register has no Live interval", MO, MONum);
}
@@ -1517,22 +1525,13 @@ void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR,
// A live segment can end with either a redefinition, a kill flag on a
// use, or a dead flag on a def.
bool hasRead = false;
- bool hasDeadDef = false;
for (ConstMIBundleOperands MOI(MI); MOI.isValid(); ++MOI) {
if (!MOI->isReg() || MOI->getReg() != Reg)
continue;
if (MOI->readsReg())
hasRead = true;
- if (MOI->isDef() && MOI->isDead())
- hasDeadDef = true;
}
-
- if (S.end.isDead()) {
- if (!hasDeadDef) {
- report("Instruction doesn't have a dead def operand", MI);
- *OS << S << " in " << LR << '\n';
- }
- } else {
+ if (!S.end.isDead()) {
if (!hasRead) {
report("Instruction ending live segment doesn't read the register", MI);
*OS << S << " in " << LR << '\n';