diff options
author | Matthias Braun <matze@braunis.de> | 2016-02-02 02:44:25 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-02-02 02:44:25 +0000 |
commit | 579c9cda139177d67d8030021ed81e345f74b6df (patch) | |
tree | ee4dfb5170c4e597bc73a508f9fa5c39bfa66715 | |
parent | 881de4d12acc3afc3973adb2701c4f5a213e8fb9 (diff) | |
download | bcm5719-llvm-579c9cda139177d67d8030021ed81e345f74b6df.tar.gz bcm5719-llvm-579c9cda139177d67d8030021ed81e345f74b6df.zip |
MachineVerifier: Use report_context() instead of ad-hoc messages.
llvm-svn: 259457
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index 428295ec2cc..de4ad4ade6d 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -217,6 +217,9 @@ namespace { LaneBitmask LaneMask) const; void report_context(const LiveRange::Segment &S) const; void report_context(const VNInfo &VNI) const; + void report_context(SlotIndex Pos) const; + void report_context_liverange(const LiveRange &LR) const; + void report_context_regunit(unsigned RegUnit) const; void verifyInlineAsm(const MachineInstr *MI); @@ -435,16 +438,20 @@ void MachineVerifier::report(const char *msg, errs() << "\n"; } +void MachineVerifier::report_context(SlotIndex Pos) const { + errs() << "- at: " << Pos << '\n'; +} + void MachineVerifier::report_context(const LiveInterval &LI) const { errs() << "- interval: " << LI << '\n'; } void MachineVerifier::report_context(const LiveRange &LR, unsigned Reg, LaneBitmask LaneMask) const { + report_context_liverange(LR); errs() << "- register: " << PrintReg(Reg, TRI) << '\n'; if (LaneMask != 0) errs() << "- lanemask: " << PrintLaneMask(LaneMask) << '\n'; - errs() << "- liverange: " << LR << '\n'; } void MachineVerifier::report_context(const LiveRange::Segment &S) const { @@ -455,6 +462,14 @@ void MachineVerifier::report_context(const VNInfo &VNI) const { errs() << "- ValNo: " << VNI.id << " (def " << VNI.def << ")\n"; } +void MachineVerifier::report_context_liverange(const LiveRange &LR) const { + errs() << "- liverange: " << LR << '\n'; +} + +void MachineVerifier::report_context_regunit(unsigned RegUnit) const { + errs() << "- regunit: " << PrintRegUnit(RegUnit, TRI) << '\n'; +} + void MachineVerifier::markReachable(const MachineBasicBlock *MBB) { BBInfo &MInfo = MBBInfoMap[MBB]; if (!MInfo.reachable) { @@ -1057,12 +1072,15 @@ void MachineVerifier::checkLiveness(const MachineOperand *MO, unsigned MONum) { LiveQueryResult LRQ = LR->Query(UseIdx); if (!LRQ.valueIn()) { report("No live segment at use", MO, MONum); - errs() << UseIdx << " is not live in " << PrintRegUnit(*Units, TRI) - << ' ' << *LR << '\n'; + report_context_liverange(*LR); + report_context_regunit(*Units); + report_context(UseIdx); } if (MO->isKill() && !LRQ.isKill()) { report("Live range continues after kill flag", MO, MONum); - errs() << PrintRegUnit(*Units, TRI) << ' ' << *LR << '\n'; + report_context_liverange(*LR); + report_context_regunit(*Units); + report_context(UseIdx); } } } @@ -1075,13 +1093,15 @@ void MachineVerifier::checkLiveness(const MachineOperand *MO, unsigned MONum) { LiveQueryResult LRQ = LI.Query(UseIdx); if (!LRQ.valueIn()) { report("No live segment at use", MO, MONum); - errs() << UseIdx << " is not live in " << LI << '\n'; + report_context(LI); + report_context(UseIdx); } // Check for extra kill flags. // Note that we allow missing kill flags for now. if (MO->isKill() && !LRQ.isKill()) { report("Live range continues after kill flag", MO, MONum); - errs() << "Live range: " << LI << '\n'; + report_context(LI); + report_context(UseIdx); } } else { report("Virtual register has no live interval", MO, MONum); @@ -1164,19 +1184,21 @@ void MachineVerifier::checkLiveness(const MachineOperand *MO, unsigned MONum) { assert(VNI && "NULL valno is not allowed"); if (VNI->def != DefIdx) { report("Inconsistent valno->def", MO, MONum); - errs() << "Valno " << VNI->id << " is not defined at " - << DefIdx << " in " << LI << '\n'; + report_context(LI); + report_context(*VNI); + report_context(DefIdx); } } else { report("No live segment at def", MO, MONum); - errs() << DefIdx << " is not live in " << LI << '\n'; + report_context(LI); + report_context(DefIdx); } // 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); - errs() << "Live range: " << LI << '\n'; + report_context(LI); } } } else { |