From 50f846d63443781a5c00ec7022c381c4f09f543d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 12 May 2022 12:22:51 +0200 Subject: [PATCH] [FastISel] Add some debug output (NFC) Print a debug message when aborting isel (next to the ORE report) and when folding a load. --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index dab5d3fe68a8..cd1d63086edc 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -706,6 +706,7 @@ static void reportFastISelFailure(MachineFunction &MF, report_fatal_error(Twine(R.getMsg())); ORE.emit(R); + LLVM_DEBUG(dbgs() << R.getMsg() << "\n"); } void SelectionDAGISel::SelectBasicBlock(BasicBlock::const_iterator Begin, @@ -1524,6 +1525,8 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) { BeforeInst->hasOneUse() && FastIS->tryToFoldLoad(cast(BeforeInst), Inst)) { // If we succeeded, don't re-select the load. + LLVM_DEBUG(dbgs() + << "FastISel folded load: " << *BeforeInst << "\n"); BI = std::next(BasicBlock::const_iterator(BeforeInst)); --NumFastIselRemaining; ++NumFastIselSuccess;