[PATCH] D149345: [Utils] Added the ability to print the pass number and IR after it is triggered

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 15:11:28 PDT 2023


aeubanks added a comment.

just curious, what's the use case for this?



================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:739
+    if (shouldPrintPassNumbers())
+      dbgs() << " Running pass " << CurrentPassNumber << " " << PassID << "\n";
+
----------------
seems like this should be part of `PrintPassInstrumentation` instead


================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:742
+    if (shouldPrintAfterPassNumber() && CurrentPassNumber == PrintAfterPassNumber) {
+      dbgs() << "*** IR Dump After " << CurrentPassNumber << "-" << PassID
+             << " on " << IRName << " ***\n";
----------------
this duplicates the logic below and always prints the entire module, can you keep it more consistent with the current code?


================
Comment at: llvm/test/Other/print-after-pass-number.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
+; RUN: opt -passes="loop(indvars,loop-deletion,loop-unroll-full)" -print-after-pass-number=3 -S -o /dev/null %s 2>&1 | FileCheck %s
----------------
this shouldn't use update_test_checks.py, it should be checking the headers the instrumentation prints


================
Comment at: llvm/test/Other/print-pass-number.ll:3
+;
+; REQUIRES: asserts
+
----------------
I don't think this requires asserts


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149345/new/

https://reviews.llvm.org/D149345



More information about the llvm-commits mailing list