From: Ahmed Bougacha Date: Tue, 8 Nov 2016 19:27:13 +0000 (+0000) Subject: [GlobalISel] Dump all instructions inserted by selector. X-Git-Tag: llvmorg-4.0.0-rc1~5212 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53a03a28c4e88816994deaec3a835458b8df35d2;p=platform%2Fupstream%2Fllvm.git [GlobalISel] Dump all instructions inserted by selector. This is helpful when multiple instructions are inserted. llvm-svn: 286273 --- diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp index 653c242..6688142 100644 --- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp +++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp @@ -113,13 +113,19 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) { if (!ISel->select(MI)) { if (TPC.isGlobalISelAbortEnabled()) - // FIXME: It would be nice to dump all inserted instructions. It's - // not - // obvious how, esp. considering select() can insert after MI. reportSelectionError(MI, "Cannot select"); Failed = true; break; } + + // Dump the range of instructions that MI expanded into. + DEBUG({ + auto InsertedBegin = ReachedBegin ? MBB->begin() : std::next(MII); + dbgs() << "Into:\n"; + for (auto &InsertedMI : make_range(InsertedBegin, AfterIt)) + dbgs() << " " << InsertedMI; + dbgs() << '\n'; + }); } }