diff options
| author | Florian Hahn <flo@fhahn.com> | 2019-01-08 15:16:23 +0000 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2019-01-08 15:16:23 +0000 |
| commit | c1ece1b41b3b0f2fb7de83ae5dc7d3aaf1729b40 (patch) | |
| tree | 8deb3bbf97ad3ae27f56ffc8180b9022bc786eda /llvm/lib/CodeGen | |
| parent | e7c8acbb3761721255f9399048f950ac50a2bf32 (diff) | |
| download | bcm5719-llvm-c1ece1b41b3b0f2fb7de83ae5dc7d3aaf1729b40.tar.gz bcm5719-llvm-c1ece1b41b3b0f2fb7de83ae5dc7d3aaf1729b40.zip | |
[MachineVerifier] Include offending register in allocatable live-in error msg.
This patch adds a convenience report() method for physical registers and
uses it to print the offending register with the 'MBB has allocatable
live-in' error.
Reviewers: MatzeB, rtereshin, dsanders
Reviewed By: dsanders
Differential Revision: https://reviews.llvm.org/D55946
llvm-svn: 350630
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index f4804e734f6..3128e5a7666 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -250,6 +250,7 @@ namespace { void report_context(const LiveRange::Segment &S) const; void report_context(const VNInfo &VNI) const; void report_context(SlotIndex Pos) const; + void report_context(MCPhysReg PhysReg) const; void report_context_liverange(const LiveRange &LR) const; void report_context_lanemask(LaneBitmask LaneMask) const; void report_context_vreg(unsigned VReg) const; @@ -540,6 +541,10 @@ void MachineVerifier::report_context_liverange(const LiveRange &LR) const { errs() << "- liverange: " << LR << '\n'; } +void MachineVerifier::report_context(MCPhysReg PReg) const { + errs() << "- p. register: " << printReg(PReg, TRI) << '\n'; +} + void MachineVerifier::report_context_vreg(unsigned VReg) const { errs() << "- v. register: " << printReg(VReg, TRI) << '\n'; } @@ -619,6 +624,7 @@ MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) { if (isAllocatable(LI.PhysReg) && !MBB->isEHPad() && MBB->getIterator() != MBB->getParent()->begin()) { report("MBB has allocatable live-in, but isn't entry or landing-pad.", MBB); + report_context(LI.PhysReg); } } } |

