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

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 03:07:35 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-globalisel

Author: David Green (davemgreen)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/83401.diff


1 Files Affected:

- (modified) llvm/lib/CodeGen/GlobalISel/Legalizer.cpp (+1) 


``````````diff
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()) {

``````````

</details>


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


More information about the llvm-commits mailing list