[llvm] [GlobalISel] Dump the machine function after each legalization iteration. NFC (PR #83401)

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 03:06:52 PST 2024


https://github.com/davemgreen created https://github.com/llvm/llvm-project/pull/83401

I find this useful to see the current state of the machine function as legalization continues. Otherwise it is difficult to view the whole thing as individual combines/legalizations are occurring.

>From e10c7859c87bbbbcc48b8962d8fdcaf6edd962d5 Mon Sep 17 00:00:00 2001
From: David Green <david.green at arm.com>
Date: Thu, 29 Feb 2024 10:10:12 +0000
Subject: [PATCH] [GlobalISel] Dump the machine function after each
 legalization iteration. NFC

I find this useful to see the current state of the machine function as
legalization continues. Otherwise it is difficult to view the whole thing as
individual combines/legalizations are occuring.
---
 llvm/lib/CodeGen/GlobalISel/Legalizer.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
index 6d75258c1041b1..2257b9b35b99aa 100644
--- a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
@@ -223,6 +223,7 @@ Legalizer::legalizeMachineFunction(MachineFunction &MF, const LegalizerInfo &LI,
   SmallVector<MachineInstr *, 128> RetryList;
   do {
     LLVM_DEBUG(dbgs() << "=== New Iteration ===\n");
+    LLVM_DEBUG(MF.dump());
     assert(RetryList.empty() && "Expected no instructions in RetryList");
     unsigned NumArtifacts = ArtifactList.size();
     while (!InstList.empty()) {



More information about the llvm-commits mailing list