From 9f3e5744ab4cf255f9cbf674a93fb844c510067f Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Sat, 10 Mar 2012 00:36:06 +0000 Subject: Add SSA verification to MachineVerifier. Somehow we never verified SSA dominance before. llvm-svn: 152458 --- llvm/lib/CodeGen/MachineVerifier.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index f26886fd20f..91a536d0631 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -1014,8 +1014,18 @@ void MachineVerifier::visitMachineFunctionAfter() { } // Now check liveness info if available - if (LiveVars || LiveInts) - calcRegsRequired(); + calcRegsRequired(); + + if (MRI->isSSA() && !MF->empty()) { + BBInfo &MInfo = MBBInfoMap[&MF->front()]; + for (RegSet::iterator + I = MInfo.vregsRequired.begin(), E = MInfo.vregsRequired.end(); I != E; + ++I) { + report("Virtual register def doesn't dominate all uses.", MF); + *OS << "- register:\t" << PrintReg(*I) << '\n'; + } + } + if (LiveVars) verifyLiveVariables(); if (LiveInts) -- cgit v1.2.3