diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2024-09-24 22:32:53 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 22:32:53 +0400 |
commit | 71ca9fcb8dc9ea0e1e3a4a47820edc78c398a85e (patch) | |
tree | 9a9a8cf014f391ca4f366b1d9448ed1a0a7519ed /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | 6d3d5f30bd58af6d16d0b4b7d32dc3ead1e098ec (diff) | |
download | llvm-71ca9fcb8dc9ea0e1e3a4a47820edc78c398a85e.zip llvm-71ca9fcb8dc9ea0e1e3a4a47820edc78c398a85e.tar.gz llvm-71ca9fcb8dc9ea0e1e3a4a47820edc78c398a85e.tar.bz2 |
llvm-reduce: Don't print verifier failed machine functions (#109673)
This produces far too much terminal output, particularly for the
instruction reduction. Since it doesn't consider the liveness of of
the instructions it's deleting, it produces quite a lot of verifier
errors.
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 232 |
1 files changed, 120 insertions, 112 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index e1295ec8..24a0f41 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -94,21 +94,24 @@ using namespace llvm; namespace { struct MachineVerifier { - MachineVerifier(MachineFunctionAnalysisManager &MFAM, const char *b) - : MFAM(&MFAM), Banner(b) {} + MachineVerifier(MachineFunctionAnalysisManager &MFAM, const char *b, + raw_ostream *OS) + : MFAM(&MFAM), OS(OS ? *OS : nulls()), Banner(b) {} - MachineVerifier(Pass *pass, const char *b) : PASS(pass), Banner(b) {} + MachineVerifier(Pass *pass, const char *b, raw_ostream *OS) + : PASS(pass), OS(OS ? *OS : nulls()), Banner(b) {} MachineVerifier(const char *b, LiveVariables *LiveVars, LiveIntervals *LiveInts, LiveStacks *LiveStks, - SlotIndexes *Indexes) - : Banner(b), LiveVars(LiveVars), LiveInts(LiveInts), LiveStks(LiveStks), - Indexes(Indexes) {} + SlotIndexes *Indexes, raw_ostream *OS) + : OS(OS ? *OS : nulls()), Banner(b), LiveVars(LiveVars), + LiveInts(LiveInts), LiveStks(LiveStks), Indexes(Indexes) {} unsigned verify(const MachineFunction &MF); MachineFunctionAnalysisManager *MFAM = nullptr; Pass *const PASS = nullptr; + raw_ostream &OS; const char *Banner; const MachineFunction *MF = nullptr; const TargetMachine *TM = nullptr; @@ -334,7 +337,8 @@ namespace { MachineFunctionProperties::Property::FailsVerification)) return false; - unsigned FoundErrors = MachineVerifier(this, Banner.c_str()).verify(MF); + unsigned FoundErrors = + MachineVerifier(this, Banner.c_str(), &errs()).verify(MF); if (FoundErrors) report_fatal_error("Found "+Twine(FoundErrors)+" machine code errors."); return false; @@ -352,7 +356,8 @@ MachineVerifierPass::run(MachineFunction &MF, if (MF.getProperties().hasProperty( MachineFunctionProperties::Property::FailsVerification)) return PreservedAnalyses::all(); - unsigned FoundErrors = MachineVerifier(MFAM, Banner.c_str()).verify(MF); + unsigned FoundErrors = + MachineVerifier(MFAM, Banner.c_str(), &errs()).verify(MF); if (FoundErrors) report_fatal_error("Found " + Twine(FoundErrors) + " machine code errors."); return PreservedAnalyses::all(); @@ -374,25 +379,28 @@ void llvm::verifyMachineFunction(const std::string &Banner, // LiveIntervals *LiveInts; // LiveStacks *LiveStks; // SlotIndexes *Indexes; - unsigned FoundErrors = MachineVerifier(nullptr, Banner.c_str()).verify(MF); + unsigned FoundErrors = + MachineVerifier(nullptr, Banner.c_str(), &errs()).verify(MF); if (FoundErrors) report_fatal_error("Found " + Twine(FoundErrors) + " machine code errors."); } -bool MachineFunction::verify(Pass *p, const char *Banner, bool AbortOnErrors) - const { +bool MachineFunction::verify(Pass *p, const char *Banner, raw_ostream *OS, + bool AbortOnErrors) const { MachineFunction &MF = const_cast<MachineFunction&>(*this); - unsigned FoundErrors = MachineVerifier(p, Banner).verify(MF); + unsigned FoundErrors = MachineVerifier(p, Banner, OS).verify(MF); if (AbortOnErrors && FoundErrors) report_fatal_error("Found "+Twine(FoundErrors)+" machine code errors."); return FoundErrors == 0; } bool MachineFunction::verify(LiveIntervals *LiveInts, SlotIndexes *Indexes, - const char *Banner, bool AbortOnErrors) const { + const char *Banner, raw_ostream *OS, + bool AbortOnErrors) const { MachineFunction &MF = const_cast<MachineFunction &>(*this); unsigned FoundErrors = - MachineVerifier(Banner, nullptr, LiveInts, nullptr, Indexes).verify(MF); + MachineVerifier(Banner, nullptr, LiveInts, nullptr, Indexes, OS) + .verify(MF); if (AbortOnErrors && FoundErrors) report_fatal_error("Found " + Twine(FoundErrors) + " machine code errors."); return FoundErrors == 0; @@ -482,7 +490,7 @@ unsigned MachineVerifier::verify(const MachineFunction &MF) { for (const MachineInstr &MI : MBB.instrs()) { if (MI.getParent() != &MBB) { report("Bad instruction parent pointer", &MBB); - errs() << "Instruction: " << MI; + OS << "Instruction: " << MI; continue; } @@ -540,46 +548,48 @@ unsigned MachineVerifier::verify(const MachineFunction &MF) { void MachineVerifier::report(const char *msg, const MachineFunction *MF) { assert(MF); - errs() << '\n'; + OS << '\n'; if (!foundErrors++) { if (Banner) - errs() << "# " << Banner << '\n'; + OS << "# " << Banner << '\n'; + if (LiveInts != nullptr) - LiveInts->print(errs()); + LiveInts->print(OS); else - MF->print(errs(), Indexes); + MF->print(OS, Indexes); } - errs() << "*** Bad machine code: " << msg << " ***\n" - << "- function: " << MF->getName() << "\n"; + + OS << "*** Bad machine code: " << msg << " ***\n" + << "- function: " << MF->getName() << '\n'; } void MachineVerifier::report(const char *msg, const MachineBasicBlock *MBB) { assert(MBB); report(msg, MBB->getParent()); - errs() << "- basic block: " << printMBBReference(*MBB) << ' ' - << MBB->getName() << " (" << (const void *)MBB << ')'; + OS << "- basic block: " << printMBBReference(*MBB) << ' ' << MBB->getName() + << " (" << (const void *)MBB << ')'; if (Indexes) - errs() << " [" << Indexes->getMBBStartIdx(MBB) - << ';' << Indexes->getMBBEndIdx(MBB) << ')'; - errs() << '\n'; + OS << " [" << Indexes->getMBBStartIdx(MBB) << ';' + << Indexes->getMBBEndIdx(MBB) << ')'; + OS << '\n'; } void MachineVerifier::report(const char *msg, const MachineInstr *MI) { assert(MI); report(msg, MI->getParent()); - errs() << "- instruction: "; + OS << "- instruction: "; if (Indexes && Indexes->hasIndex(*MI)) - errs() << Indexes->getInstructionIndex(*MI) << '\t'; - MI->print(errs(), /*IsStandalone=*/true); + OS << Indexes->getInstructionIndex(*MI) << '\t'; + MI->print(OS, /*IsStandalone=*/true); } void MachineVerifier::report(const char *msg, const MachineOperand *MO, unsigned MONum, LLT MOVRegType) { assert(MO); report(msg, MO->getParent()); - errs() << "- operand " << MONum << ": "; - MO->print(errs(), MOVRegType, TRI); - errs() << "\n"; + OS << "- operand " << MONum << ": "; + MO->print(OS, MOVRegType, TRI); + OS << '\n'; } void MachineVerifier::report(const Twine &Msg, const MachineInstr *MI) { @@ -587,11 +597,11 @@ void MachineVerifier::report(const Twine &Msg, const MachineInstr *MI) { } void MachineVerifier::report_context(SlotIndex Pos) const { - errs() << "- at: " << Pos << '\n'; + OS << "- at: " << Pos << '\n'; } void MachineVerifier::report_context(const LiveInterval &LI) const { - errs() << "- interval: " << LI << '\n'; + OS << "- interval: " << LI << '\n'; } void MachineVerifier::report_context(const LiveRange &LR, Register VRegUnit, @@ -603,35 +613,35 @@ void MachineVerifier::report_context(const LiveRange &LR, Register VRegUnit, } void MachineVerifier::report_context(const LiveRange::Segment &S) const { - errs() << "- segment: " << S << '\n'; + OS << "- segment: " << S << '\n'; } void MachineVerifier::report_context(const VNInfo &VNI) const { - errs() << "- ValNo: " << VNI.id << " (def " << VNI.def << ")\n"; + OS << "- ValNo: " << VNI.id << " (def " << VNI.def << ")\n"; } void MachineVerifier::report_context_liverange(const LiveRange &LR) const { - errs() << "- liverange: " << LR << '\n'; + OS << "- liverange: " << LR << '\n'; } void MachineVerifier::report_context(MCPhysReg PReg) const { - errs() << "- p. register: " << printReg(PReg, TRI) << '\n'; + OS << "- p. register: " << printReg(PReg, TRI) << '\n'; } void MachineVerifier::report_context_vreg(Register VReg) const { - errs() << "- v. register: " << printReg(VReg, TRI) << '\n'; + OS << "- v. register: " << printReg(VReg, TRI) << '\n'; } void MachineVerifier::report_context_vreg_regunit(Register VRegOrUnit) const { if (VRegOrUnit.isVirtual()) { report_context_vreg(VRegOrUnit); } else { - errs() << "- regunit: " << printRegUnit(VRegOrUnit, TRI) << '\n'; + OS << "- regunit: " << printRegUnit(VRegOrUnit, TRI) << '\n'; } } void MachineVerifier::report_context_lanemask(LaneBitmask LaneMask) const { - errs() << "- lanemask: " << PrintLaneMask(LaneMask) << '\n'; + OS << "- lanemask: " << PrintLaneMask(LaneMask) << '\n'; } void MachineVerifier::markReachable(const MachineBasicBlock *MBB) { @@ -710,8 +720,8 @@ MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) { report("MBB has successor that isn't part of the function.", MBB); if (!MBBInfoMap[succ].Preds.count(MBB)) { report("Inconsistent CFG", MBB); - errs() << "MBB is not in the predecessor list of the successor " - << printMBBReference(*succ) << ".\n"; + OS << "MBB is not in the predecessor list of the successor " + << printMBBReference(*succ) << ".\n"; } } @@ -721,8 +731,8 @@ MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) { report("MBB has predecessor that isn't part of the function.", MBB); if (!MBBInfoMap[Pred].Succs.count(MBB)) { report("Inconsistent CFG", MBB); - errs() << "MBB is not in the successor list of the predecessor " - << printMBBReference(*Pred) << ".\n"; + OS << "MBB is not in the successor list of the predecessor " + << printMBBReference(*Pred) << ".\n"; } } @@ -880,7 +890,7 @@ void MachineVerifier::visitMachineBundleBefore(const MachineInstr *MI) { SlotIndex idx = Indexes->getInstructionIndex(*MI); if (!(idx > lastIndex)) { report("Instruction index out of order", MI); - errs() << "Last instruction was at " << lastIndex << '\n'; + OS << "Last instruction was at " << lastIndex << '\n'; } lastIndex = idx; } @@ -894,7 +904,7 @@ void MachineVerifier::visitMachineBundleBefore(const MachineInstr *MI) { // precede non-terminators. if (FirstTerminator->getOpcode() != TargetOpcode::G_INVOKE_REGION_START) { report("Non-terminator instruction after the first terminator", MI); - errs() << "First terminator was:\t" << *FirstTerminator; + OS << "First terminator was:\t" << *FirstTerminator; } } } @@ -2185,8 +2195,8 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) { const MCInstrDesc &MCID = MI->getDesc(); if (MI->getNumOperands() < MCID.getNumOperands()) { report("Too few operands", MI); - errs() << MCID.getNumOperands() << " operands expected, but " - << MI->getNumOperands() << " given.\n"; + OS << MCID.getNumOperands() << " operands expected, but " + << MI->getNumOperands() << " given.\n"; } if (MI->getFlag(MachineInstr::NoConvergent) && !MCID.isConvergent()) @@ -2278,7 +2288,7 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) { // If both types are valid, check that the types are the same. if (SrcTy != DstTy) { report("Copy Instruction is illegal with mismatching types", MI); - errs() << "Def = " << DstTy << ", Src = " << SrcTy << "\n"; + OS << "Def = " << DstTy << ", Src = " << SrcTy << '\n'; } break; @@ -2322,8 +2332,7 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) { if (SrcSize.isNonZero() && DstSize.isNonZero() && SrcSize != DstSize) { if (!DstOp.getSubReg() && !SrcOp.getSubReg()) { report("Copy Instruction is illegal with mismatching sizes", MI); - errs() << "Def Size = " << DstSize << ", Src Size = " << SrcSize - << "\n"; + OS << "Def Size = " << DstSize << ", Src Size = " << SrcSize << '\n'; } } break; @@ -2554,8 +2563,8 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) { TII->getRegClass(MCID, MONum, TRI, *MF)) { if (!DRC->contains(Reg)) { report("Illegal physical register for instruction", MO, MONum); - errs() << printReg(Reg, TRI) << " is not a " - << TRI->getRegClassName(DRC) << " register.\n"; + OS << printReg(Reg, TRI) << " is not a " + << TRI->getRegClassName(DRC) << " register.\n"; } } } @@ -2618,9 +2627,9 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) { RBI->getMaximumSize(RegBank->getID()) < Ty.getSizeInBits()) { report("Register bank is too small for virtual register", MO, MONum); - errs() << "Register bank " << RegBank->getName() << " too small(" - << RBI->getMaximumSize(RegBank->getID()) << ") to fit " - << Ty.getSizeInBits() << "-bits\n"; + OS << "Register bank " << RegBank->getName() << " too small(" + << RBI->getMaximumSize(RegBank->getID()) << ") to fit " + << Ty.getSizeInBits() << "-bits\n"; return; } } @@ -2639,10 +2648,9 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) { TII->getRegClass(MCID, MONum, TRI, *MF)) { report("Virtual register does not match instruction constraint", MO, MONum); - errs() << "Expect register class " - << TRI->getRegClassName( - TII->getRegClass(MCID, MONum, TRI, *MF)) - << " but got nothing\n"; + OS << "Expect register class " + << TRI->getRegClassName(TII->getRegClass(MCID, MONum, TRI, *MF)) + << " but got nothing\n"; return; } @@ -2653,14 +2661,14 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) { TRI->getSubClassWithSubReg(RC, SubIdx); if (!SRC) { report("Invalid subregister index for virtual register", MO, MONum); - errs() << "Register class " << TRI->getRegClassName(RC) - << " does not support subreg index " << SubIdx << "\n"; + OS << "Register class " << TRI->getRegClassName(RC) + << " does not support subreg index " << SubIdx << '\n'; return; } if (RC != SRC) { report("Invalid register class for subregister index", MO, MONum); - errs() << "Register class " << TRI->getRegClassName(RC) - << " does not fully support subreg index " << SubIdx << "\n"; + OS << "Register class " << TRI->getRegClassName(RC) + << " does not fully support subreg index " << SubIdx << '\n'; return; } } @@ -2682,9 +2690,9 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) { } if (!RC->hasSuperClassEq(DRC)) { report("Illegal virtual register for instruction", MO, MONum); - errs() << "Expected a " << TRI->getRegClassName(DRC) - << " register, but got a " << TRI->getRegClassName(RC) - << " register\n"; + OS << "Expected a " << TRI->getRegClassName(DRC) + << " register, but got a " << TRI->getRegClassName(RC) + << " register\n"; } } } @@ -2733,11 +2741,11 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) { } if (loads && !LI.liveAt(Idx.getRegSlot(true))) { report("Instruction loads from dead spill slot", MO, MONum); - errs() << "Live stack: " << LI << '\n'; + OS << "Live stack: " << LI << '\n'; } if (stores && !LI.liveAt(Idx.getRegSlot())) { report("Instruction stores to dead spill slot", MO, MONum); - errs() << "Live stack: " << LI << '\n'; + OS << "Live stack: " << LI << '\n'; } } break; @@ -3050,8 +3058,8 @@ MachineVerifier::visitMachineBasicBlockAfter(const MachineBasicBlock *MBB) { SlotIndex stop = Indexes->getMBBEndIdx(MBB); if (!(stop > lastIndex)) { report("Block ends before last instruction index", MBB); - errs() << "Block ends at " << stop - << " last instruction was at " << lastIndex << '\n'; + OS << "Block ends at " << stop << " last instruction was at " << lastIndex + << '\n'; } lastIndex = stop; } @@ -3296,8 +3304,8 @@ void MachineVerifier::checkPHIOps(const MachineBasicBlock &MBB) { for (MachineBasicBlock *Pred : MBB.predecessors()) { if (!seen.count(Pred)) { report("Missing PHI operand", &Phi); - errs() << printMBBReference(*Pred) - << " is a predecessor according to the CFG.\n"; + OS << printMBBReference(*Pred) + << " is a predecessor according to the CFG.\n"; } } } @@ -3306,9 +3314,10 @@ void MachineVerifier::checkPHIOps(const MachineBasicBlock &MBB) { static void verifyConvergenceControl(const MachineFunction &MF, MachineDominatorTree &DT, - std::function<void(const Twine &Message)> FailureCB) { + std::function<void(const Twine &Message)> FailureCB, + raw_ostream &OS) { MachineConvergenceVerifier CV; - CV.initialize(&errs(), FailureCB, MF); + CV.initialize(&OS, FailureCB, MF); for (const auto &MBB : MF) { CV.visit(MBB); @@ -3326,7 +3335,7 @@ void MachineVerifier::visitMachineFunctionAfter() { auto FailureCB = [this](const Twine &Message) { report(Message.str().c_str(), MF); }; - verifyConvergenceControl(*MF, DT, FailureCB); + verifyConvergenceControl(*MF, DT, FailureCB, OS); calcRegsPassed(); @@ -3342,8 +3351,8 @@ void MachineVerifier::visitMachineFunctionAfter() { for (Register VReg : MInfo.vregsRequired) if (MInfo.regsKilled.count(VReg)) { report("Virtual register killed in block, but needed live out.", &MBB); - errs() << "Virtual register " << printReg(VReg) - << " is used after the block.\n"; + OS << "Virtual register " << printReg(VReg) + << " is used after the block.\n"; } } @@ -3379,9 +3388,8 @@ void MachineVerifier::visitMachineFunctionAfter() { if (!PInfo.regsLiveOut.count(LiveInReg)) { report("Live in register not found to be live out from predecessor.", &MBB); - errs() << TRI->getName(LiveInReg) - << " not found to be live out from " - << printMBBReference(*Pred) << "\n"; + OS << TRI->getName(LiveInReg) << " not found to be live out from " + << printMBBReference(*Pred) << '\n'; } } } @@ -3418,14 +3426,14 @@ void MachineVerifier::verifyLiveVariables() { if (MInfo.vregsRequired.count(Reg)) { if (!VI.AliveBlocks.test(MBB.getNumber())) { report("LiveVariables: Block missing from AliveBlocks", &MBB); - errs() << "Virtual register " << printReg(Reg) - << " must be live through the block.\n"; + OS << "Virtual register " << printReg(Reg) + << " must be live through the block.\n"; } } else { if (VI.AliveBlocks.test(MBB.getNumber())) { report("LiveVariables: Block should not be in AliveBlocks", &MBB); - errs() << "Virtual register " << printReg(Reg) - << " is not needed live through the block.\n"; + OS << "Virtual register " << printReg(Reg) + << " is not needed live through the block.\n"; } } } @@ -3443,7 +3451,7 @@ void MachineVerifier::verifyLiveIntervals() { if (!LiveInts->hasInterval(Reg)) { report("Missing live interval for virtual register", MF); - errs() << printReg(Reg, TRI) << " still has defs or uses\n"; + OS << printReg(Reg, TRI) << " still has defs or uses\n"; continue; } @@ -3755,9 +3763,9 @@ void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR, report("Register not marked live out of predecessor", Pred); report_context(LR, Reg, LaneMask); report_context(*VNI); - errs() << " live into " << printMBBReference(*MFI) << '@' - << LiveInts->getMBBStartIdx(&*MFI) << ", not live before " - << PEnd << '\n'; + OS << " live into " << printMBBReference(*MFI) << '@' + << LiveInts->getMBBStartIdx(&*MFI) << ", not live before " << PEnd + << '\n'; continue; } @@ -3765,10 +3773,10 @@ void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR, if (!IsPHI && PVNI != VNI) { report("Different value live out of predecessor", Pred); report_context(LR, Reg, LaneMask); - errs() << "Valno #" << PVNI->id << " live out of " - << printMBBReference(*Pred) << '@' << PEnd << "\nValno #" - << VNI->id << " live into " << printMBBReference(*MFI) << '@' - << LiveInts->getMBBStartIdx(&*MFI) << '\n'; + OS << "Valno #" << PVNI->id << " live out of " + << printMBBReference(*Pred) << '@' << PEnd << "\nValno #" << VNI->id + << " live into " << printMBBReference(*MFI) << '@' + << LiveInts->getMBBStartIdx(&*MFI) << '\n'; } } if (&*MFI == EndMBB) @@ -3823,11 +3831,11 @@ void MachineVerifier::verifyLiveInterval(const LiveInterval &LI) { report("Multiple connected components in live interval", MF); report_context(LI); for (unsigned comp = 0; comp != NumComp; ++comp) { - errs() << comp << ": valnos"; + OS << comp << ": valnos"; for (const VNInfo *I : LI.valnos) if (comp == ConEQ.getEqClass(I)) - errs() << ' ' << I->id; - errs() << '\n'; + OS << ' ' << I->id; + OS << '\n'; } } } @@ -3889,9 +3897,9 @@ void MachineVerifier::verifyStackFrame() { report("Call frame size on entry does not match value computed from " "predecessor", MBB); - errs() << "Call frame size on entry " << MBB->getCallFrameSize() - << " does not match value computed from predecessor " - << -BBState.EntryValue << '\n'; + OS << "Call frame size on entry " << MBB->getCallFrameSize() + << " does not match value computed from predecessor " + << -BBState.EntryValue << '\n'; } // Update stack state by checking contents of MBB. @@ -3914,8 +3922,8 @@ void MachineVerifier::verifyStackFrame() { BBState.ExitValue; if (BBState.ExitIsSetup && AbsSPAdj != Size) { report("FrameDestroy <n> is after FrameSetup <m>", &I); - errs() << "FrameDestroy <" << Size << "> is after FrameSetup <" - << AbsSPAdj << ">.\n"; + OS << "FrameDestroy <" << Size << "> is after FrameSetup <" + << AbsSPAdj << ">.\n"; } if (!MRI->isSSA() && !MF->getFrameInfo().adjustsStack()) report("AdjustsStack not set in presence of a frame pseudo " @@ -3933,11 +3941,11 @@ void MachineVerifier::verifyStackFrame() { (SPState[Pred->getNumber()].ExitValue != BBState.EntryValue || SPState[Pred->getNumber()].ExitIsSetup != BBState.EntryIsSetup)) { report("The exit stack state of a predecessor is inconsistent.", MBB); - errs() << "Predecessor " << printMBBReference(*Pred) - << " has exit state (" << SPState[Pred->getNumber()].ExitValue - << ", " << SPState[Pred->getNumber()].ExitIsSetup << "), while " - << printMBBReference(*MBB) << " has entry state (" - << BBState.EntryValue << ", " << BBState.EntryIsSetup << ").\n"; + OS << "Predecessor " << printMBBReference(*Pred) << " has exit state (" + << SPState[Pred->getNumber()].ExitValue << ", " + << SPState[Pred->getNumber()].ExitIsSetup << "), while " + << printMBBReference(*MBB) << " has entry state (" + << BBState.EntryValue << ", " << BBState.EntryIsSetup << ").\n"; } } @@ -3948,11 +3956,11 @@ void MachineVerifier::verifyStackFrame() { (SPState[Succ->getNumber()].EntryValue != BBState.ExitValue || SPState[Succ->getNumber()].EntryIsSetup != BBState.ExitIsSetup)) { report("The entry stack state of a successor is inconsistent.", MBB); - errs() << "Successor " << printMBBReference(*Succ) - << " has entry state (" << SPState[Succ->getNumber()].EntryValue - << ", " << SPState[Succ->getNumber()].EntryIsSetup << "), while " - << printMBBReference(*MBB) << " has exit state (" - << BBState.ExitValue << ", " << BBState.ExitIsSetup << ").\n"; + OS << "Successor " << printMBBReference(*Succ) << " has entry state (" + << SPState[Succ->getNumber()].EntryValue << ", " + << SPState[Succ->getNumber()].EntryIsSetup << "), while " + << printMBBReference(*MBB) << " has exit state (" + << BBState.ExitValue << ", " << BBState.ExitIsSetup << ").\n"; } } |