Add knowledge of phi-def and phi-kill valnos to MachineVerifier's predecessor
authorCameron Zwarich <zwarich@apple.com>
Mon, 27 Dec 2010 05:17:23 +0000 (05:17 +0000)
committerCameron Zwarich <zwarich@apple.com>
Mon, 27 Dec 2010 05:17:23 +0000 (05:17 +0000)
valno verification. The "Different value live out of predecessor" check is
incorrect in the case of phi-def valnos, so just skip that check for phi-def
valnos and instead check that all of the valnos for predecessors have phi-kill.
Fixes PR8863.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122581 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineVerifier.cpp

index d5dda48cebdb2f96c66006580cff00ab04a02b8f..0c29969003903db1270d4d2dc079d4a3a50b1a28 100644 (file)
@@ -1146,7 +1146,23 @@ void MachineVerifier::verifyLiveIntervals() {
             *OS << "Valno #" << VNI->id << " live into BB#" << MFI->getNumber()
                 << '@' << LiveInts->getMBBStartIdx(MFI) << ", not live at "
                 << PEnd << " in " << LI << '\n';
-          } else if (PVNI != VNI) {
+            continue;
+          }
+
+          if (VNI->isPHIDef() && VNI->def == LiveInts->getMBBStartIdx(MFI)) {
+            if (!PVNI->hasPHIKill()) {
+              report("Value live out of predecessor doesn't have PHIKill", MF);
+              *OS << "Valno #" << PVNI->id << " live out of BB#"
+                  << (*PI)->getNumber() << '@' << PEnd
+                  << " doesn't have PHIKill, but Valno #" << VNI->id
+                  << " is PHIDef and defined at the beginning of BB#"
+                  << MFI->getNumber() << '@' << LiveInts->getMBBStartIdx(MFI)
+                  << " in " << LI << '\n';
+            }
+            continue;
+          }
+
+          if (PVNI != VNI) {
             report("Different value live out of predecessor", *PI);
             *OS << "Valno #" << PVNI->id << " live out of BB#"
                 << (*PI)->getNumber() << '@' << PEnd