Skip to content

[LowerAllowCheckPass] fix pipeline printing #146000

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

Merged

Conversation

fmayer
Copy link
Contributor

@fmayer fmayer commented Jun 27, 2025

No description provided.

Created using spr 1.3.4
@llvmbot
Copy link
Member

llvmbot commented Jun 27, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Florian Mayer (fmayer)

Changes

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

2 Files Affected:

  • (modified) llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp (+3-1)
  • (added) llvm/test/Transforms/lower-builtin-allow-check-pipeline.ll (+3)
diff --git a/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp b/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp
index f6a273262e535..196f58a8f1d1c 100644
--- a/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp
+++ b/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp
@@ -182,11 +182,13 @@ void LowerAllowCheckPass::printPipeline(
   // correctness.
   // TODO: print shorter output by combining adjacent runs, etc.
   int i = 0;
+  bool printed = false;
   for (unsigned int cutoff : Opts.cutoffs) {
     if (cutoff > 0) {
-      if (i > 0)
+      if (printed)
         OS << ";";
       OS << "cutoffs[" << i << "]=" << cutoff;
+      printed = true;
     }
 
     i++;
diff --git a/llvm/test/Transforms/lower-builtin-allow-check-pipeline.ll b/llvm/test/Transforms/lower-builtin-allow-check-pipeline.ll
new file mode 100644
index 0000000000000..7b00be97e050c
--- /dev/null
+++ b/llvm/test/Transforms/lower-builtin-allow-check-pipeline.ll
@@ -0,0 +1,3 @@
+; RUN: opt < %s -passes='require<profile-summary>,function(lower-allow-check<cutoffs[7]=0;cutoffs[8]=1>)' -S -o - -print-pipeline-passes | FileCheck %s
+
+; CHECK: lower-allow-check<cutoffs[8]=1>

@fmayer fmayer merged commit 60a18d6 into main Jun 27, 2025
9 checks passed
@fmayer fmayer deleted the users/fmayer/spr/lowerallowcheckpass-fix-pipeline-printing branch June 27, 2025 04:35
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 27, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-aarch64-darwin running on doug-worker-4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/22282

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'lit :: shtest-external-shell-kill.py' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 23
env -u FILECHECK_OPTS "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9" /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/llvm/utils/lit/lit.py -j1 --order=lexical -a Inputs/shtest-external-shell-kill | grep -v 'bash.exe: warning: could not find /tmp, please create!' | FileCheck /Users/buildbot/buildbot-root/aarch64-darwin/build/utils/lit/tests/shtest-external-shell-kill.py
# executed command: env -u FILECHECK_OPTS /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/llvm/utils/lit/lit.py -j1 --order=lexical -a Inputs/shtest-external-shell-kill
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
# executed command: grep -v 'bash.exe: warning: could not find /tmp, please create!'
# note: command had no output on stdout or stderr
# executed command: FileCheck /Users/buildbot/buildbot-root/aarch64-darwin/build/utils/lit/tests/shtest-external-shell-kill.py
# .---command stderr------------
# | �[1m/Users/buildbot/buildbot-root/aarch64-darwin/build/utils/lit/tests/shtest-external-shell-kill.py:29:15: �[0m�[0;1;31merror: �[0m�[1mCHECK-NEXT: is not on the line after the previous match
�[0m# | �[1m�[0m# CHECK-NEXT: end
# | �[0;1;32m              ^
�[0m# | �[0;1;32m�[0m�[1m<stdin>:22:6: �[0m�[0;1;30mnote: �[0m�[1m'next' match was here
�[0m# | �[1m�[0mecho end # RUN: at line 5
# | �[0;1;32m     ^
�[0m# | �[0;1;32m�[0m�[1m<stdin>:8:6: �[0m�[0;1;30mnote: �[0m�[1mprevious match ended here
�[0m# | �[1m�[0mstart
# | �[0;1;32m     ^
�[0m# | �[0;1;32m�[0m�[1m<stdin>:9:1: �[0m�[0;1;30mnote: �[0m�[1mnon-matching line after previous match is here
�[0m# | �[1m�[0m
# | �[0;1;32m^
�[0m# | �[0;1;32m�[0m
# | Input file: <stdin>
# | Check file: /Users/buildbot/buildbot-root/aarch64-darwin/build/utils/lit/tests/shtest-external-shell-kill.py
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# | �[1m�[0m�[0;1;30m          1: �[0m�[1m�[0;1;46m-- Testing: 1 tests, 1 workers -- �[0m
# | �[0;1;30m          2: �[0m�[1m�[0;1;46mFAIL: shtest-external-shell-kill :: test.txt (1 of 1) �[0m
# | �[0;1;30m          3: �[0m�[1m�[0;1;46m******************** TEST 'shtest-external-shell-kill :: test.txt' FAILED ******************** �[0m
# | �[0;1;30m          4: �[0m�[1m�[0;1;46mExit Code: 1 �[0m
# | �[0;1;30m          5: �[0m�[1m�[0;1;46m �[0m
# | �[0;1;30m          6: �[0m�[1m�[0;1;46m�[0mCommand Output (stdout):�[0;1;46m �[0m
# | �[0;1;32mcheck:26     ^~~~~~~~~~~~~~~~~~~~~~~~
�[0m# | �[0;1;32m�[0m�[0;1;30m          7: �[0m�[1m�[0;1;46m�[0m--�[0;1;46m �[0m
# | �[0;1;32mnext:27      ^~
�[0m# | �[0;1;32m�[0m�[0;1;30m          8: �[0m�[1m�[0;1;46m�[0mstart�[0;1;46m �[0m
# | �[0;1;32mnext:28      ^~~~~
�[0m# | �[0;1;32m�[0m�[0;1;30m          9: �[0m�[1m�[0;1;46m �[0m
# | �[0;1;30m         10: �[0m�[1m�[0;1;46m-- �[0m
# | �[0;1;30m         11: �[0m�[1m�[0;1;46mCommand Output (stderr): �[0m
# | �[0;1;30m         12: �[0m�[1m�[0;1;46m-- �[0m
# | �[0;1;30m         13: �[0m�[1m�[0;1;46mecho start # RUN: at line 1 �[0m
...

@@ -182,11 +182,13 @@ void LowerAllowCheckPass::printPipeline(
// correctness.
// TODO: print shorter output by combining adjacent runs, etc.
int i = 0;
bool printed = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OS << llvm:::join(llvm::map_range())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the same? This is a vector with some elements 0, and we want to skip those

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

join(map_range(make_filter_range))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an idea, not a request to change

rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants