Skip to content

[LLVM] Skip dumping inline SDag children #141359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jroelofs
Copy link
Contributor

If they're simple enough to render inline, we don't need to dump them again in the recursive walk.

If they're simple enough to render inline, we don't need to dump them again in
the recursive walk.
@llvmbot llvmbot added the llvm:SelectionDAG SelectionDAGISel as well label May 24, 2025
@llvmbot
Copy link
Member

llvmbot commented May 24, 2025

@llvm/pr-subscribers-llvm-selectiondag

Author: Jon Roelofs (jroelofs)

Changes

If they're simple enough to render inline, we don't need to dump them again in the recursive walk.


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

1 Files Affected:

  • (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp (+3)
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
index ee4297f3ad8ce..61c6a9470e531 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
@@ -1165,6 +1165,9 @@ static void printrWithDepthHelper(raw_ostream &OS, const SDNode *N,
     // Don't follow chain operands.
     if (Op.getValueType() == MVT::Other)
       continue;
+    // Don't print children that were fully rendered inline.
+    if (shouldPrintInline(*Op.getNode(), G))
+      continue;
     OS << '\n';
     printrWithDepthHelper(OS, Op.getNode(), G, depth - 1, indent + 2);
   }

@jroelofs
Copy link
Contributor Author

Great suggestion from @fpetrogalli in #141295 to simplify these dumps:

before:
image

after:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:SelectionDAG SelectionDAGISel as well
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants