diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-29 21:00:00 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-29 21:00:00 +0000 |
commit | bb0721680c329625f47c090f48dcafb2fe14101c (patch) | |
tree | d48a0a61ef09c924cc42608c83acbb484c1f3ab2 /lib | |
parent | 6c50551e9a555230f34e1abb467d575d8f11df19 (diff) | |
download | external_llvm-bb0721680c329625f47c090f48dcafb2fe14101c.zip external_llvm-bb0721680c329625f47c090f48dcafb2fe14101c.tar.gz external_llvm-bb0721680c329625f47c090f48dcafb2fe14101c.tar.bz2 |
Check for extra kill flags on live-out virtual registers.
This would previously get reported as the misleading "Virtual register
def doesn't dominate all uses."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/MachineVerifier.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineVerifier.cpp b/lib/CodeGen/MachineVerifier.cpp index a443b51..45ce3ab 100644 --- a/lib/CodeGen/MachineVerifier.cpp +++ b/lib/CodeGen/MachineVerifier.cpp @@ -1049,6 +1049,20 @@ void MachineVerifier::visitMachineFunctionAfter() { // Now check liveness info if available calcRegsRequired(); + // Check for killed virtual registers that should be live out. + for (MachineFunction::const_iterator MFI = MF->begin(), MFE = MF->end(); + MFI != MFE; ++MFI) { + BBInfo &MInfo = MBBInfoMap[MFI]; + for (RegSet::iterator + I = MInfo.vregsRequired.begin(), E = MInfo.vregsRequired.end(); I != E; + ++I) + if (MInfo.regsKilled.count(*I)) { + report("Virtual register killed in block, but needed live out.", MFI); + *OS << "Virtual register " << PrintReg(*I) + << " is used after the block.\n"; + } + } + if (!MF->empty()) { BBInfo &MInfo = MBBInfoMap[&MF->front()]; for (RegSet::iterator |