aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineVerifier.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-05 23:51:26 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-05 23:51:26 +0000
commitb4ef4a961db9d4801c12ed943e26890810eb4d6c (patch)
tree4e1387d4144fe9f8484056b5a78981a22b100ee9 /llvm/lib/CodeGen/MachineVerifier.cpp
parente0d5c458eca528edcca7eea7c839815790a15c15 (diff)
downloadllvm-b4ef4a961db9d4801c12ed943e26890810eb4d6c.zip
llvm-b4ef4a961db9d4801c12ed943e26890810eb4d6c.tar.gz
llvm-b4ef4a961db9d4801c12ed943e26890810eb4d6c.tar.bz2
Don't verify LiveVariables if LiveIntervals is available.
LiveVariables becomes horribly wrong while the coalescer is running, but the analysis is not zapped until after the coalescer pass has run. This causes tons of false reports when calling verify form the coalescer. llvm-svn: 110402
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineVerifier.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index 7ba7072..50d0476 100644
--- a/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -245,12 +245,13 @@ bool MachineVerifier::runOnMachineFunction(MachineFunction &MF) {
TRI = TM->getRegisterInfo();
MRI = &MF.getRegInfo();
+ LiveVars = NULL;
+ LiveInts = NULL;
if (PASS) {
- LiveVars = PASS->getAnalysisIfAvailable<LiveVariables>();
LiveInts = PASS->getAnalysisIfAvailable<LiveIntervals>();
- } else {
- LiveVars = NULL;
- LiveInts = NULL;
+ // We don't want to verify LiveVariables if LiveIntervals is available.
+ if (!LiveInts)
+ LiveVars = PASS->getAnalysisIfAvailable<LiveVariables>();
}
visitMachineFunctionBefore();
@@ -576,16 +577,16 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
} else
isKill = MO->isKill();
- if (isKill) {
+ if (isKill)
addRegWithSubRegs(regsKilled, Reg);
- // Check that LiveVars knows this kill
- if (LiveVars && TargetRegisterInfo::isVirtualRegister(Reg)) {
- LiveVariables::VarInfo &VI = LiveVars->getVarInfo(Reg);
- if (std::find(VI.Kills.begin(),
- VI.Kills.end(), MI) == VI.Kills.end())
- report("Kill missing from LiveVariables", MO, MONum);
- }
+ // Check that LiveVars knows this kill.
+ if (LiveVars && TargetRegisterInfo::isVirtualRegister(Reg) &&
+ MO->isKill()) {
+ LiveVariables::VarInfo &VI = LiveVars->getVarInfo(Reg);
+ if (std::find(VI.Kills.begin(),
+ VI.Kills.end(), MI) == VI.Kills.end())
+ report("Kill missing from LiveVariables", MO, MONum);
}
// Check LiveInts liveness and kill.