[llvm-commits] [llvm] r122610 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp
Cameron Zwarich
zwarich at apple.com
Tue Dec 28 15:45:38 PST 2010
Author: zwarich
Date: Tue Dec 28 17:45:38 2010
New Revision: 122610
URL: http://llvm.org/viewvc/llvm-project?rev=122610&view=rev
Log:
Simplify some code in MachineVerifier that was doing the correct thing, but not
in the most obvious way.
Modified:
llvm/trunk/lib/CodeGen/MachineVerifier.cpp
Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=122610&r1=122609&r2=122610&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Tue Dec 28 17:45:38 2010
@@ -1118,8 +1118,8 @@
// Now check all the basic blocks in this live segment.
MachineFunction::const_iterator MFI = MBB;
- // Is LI live-in to MBB and not a PHIDef?
- if (I->start == VNI->def) {
+ // Is this live range the beginning of a non-PHIDef VN?
+ if (I->start == VNI->def && !VNI->isPHIDef()) {
// Not live-in to any blocks.
if (MBB == EndMBB)
continue;
@@ -1141,16 +1141,9 @@
PE = MFI->pred_end(); PI != PE; ++PI) {
SlotIndex PEnd = LiveInts->getMBBEndIdx(*PI).getPrevSlot();
const VNInfo *PVNI = LI.getVNInfoAt(PEnd);
- if (!PVNI) {
- report("Register not marked live out of predecessor", *PI);
- *OS << "Valno #" << VNI->id << " live into BB#" << MFI->getNumber()
- << '@' << LiveInts->getMBBStartIdx(MFI) << ", not live at "
- << PEnd << " in " << LI << '\n';
- continue;
- }
if (VNI->isPHIDef() && VNI->def == LiveInts->getMBBStartIdx(MFI)) {
- if (!PVNI->hasPHIKill()) {
+ if (PVNI && !PVNI->hasPHIKill()) {
report("Value live out of predecessor doesn't have PHIKill", MF);
*OS << "Valno #" << PVNI->id << " live out of BB#"
<< (*PI)->getNumber() << '@' << PEnd
@@ -1162,6 +1155,14 @@
continue;
}
+ if (!PVNI) {
+ report("Register not marked live out of predecessor", *PI);
+ *OS << "Valno #" << VNI->id << " live into BB#" << MFI->getNumber()
+ << '@' << LiveInts->getMBBStartIdx(MFI) << ", not live at "
+ << PEnd << " in " << LI << '\n';
+ continue;
+ }
+
if (PVNI != VNI) {
report("Different value live out of predecessor", *PI);
*OS << "Valno #" << PVNI->id << " live out of BB#"
More information about the llvm-commits
mailing list