diff options
author | Matthias Braun <matze@braunis.de> | 2015-05-11 18:47:47 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2015-05-11 18:47:47 +0000 |
commit | 539175428883f84c4c8c8e6cc051a5d5b02fde88 (patch) | |
tree | 1fff3d7bef5a965498617234bfef5075f440ec60 /llvm/lib/CodeGen/LiveRangeCalc.cpp | |
parent | e958275250955852cccb156d77ae712ebf110e95 (diff) | |
download | bcm5719-llvm-539175428883f84c4c8c8e6cc051a5d5b02fde88.tar.gz bcm5719-llvm-539175428883f84c4c8c8e6cc051a5d5b02fde88.zip |
LiveRangeCalc: Improve error messages on malformed IR
llvm-svn: 237008
Diffstat (limited to 'llvm/lib/CodeGen/LiveRangeCalc.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveRangeCalc.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeCalc.cpp b/llvm/lib/CodeGen/LiveRangeCalc.cpp index 45e7265c8f4..bb2877ae31a 100644 --- a/llvm/lib/CodeGen/LiveRangeCalc.cpp +++ b/llvm/lib/CodeGen/LiveRangeCalc.cpp @@ -272,13 +272,19 @@ bool LiveRangeCalc::findReachingDefs(LiveRange &LR, MachineBasicBlock &UseMBB, #ifndef NDEBUG if (MBB->pred_empty()) { MBB->getParent()->verify(); + errs() << "Use of " << PrintReg(PhysReg) + << " does not have a corresponding definition on every path:\n"; + const MachineInstr *MI = Indexes->getInstructionFromIndex(Use); + if (MI != nullptr) + errs() << Use << " " << *MI; llvm_unreachable("Use not jointly dominated by defs."); } if (TargetRegisterInfo::isPhysicalRegister(PhysReg) && !MBB->isLiveIn(PhysReg)) { MBB->getParent()->verify(); - errs() << "The register needs to be live in to BB#" << MBB->getNumber() + errs() << "The register " << PrintReg(PhysReg) + << " needs to be live in to BB#" << MBB->getNumber() << ", but is missing from the live-in list.\n"; llvm_unreachable("Invalid global physical register"); } |