Skip to content

[Utils] update_llc_test_checks.py: updated the regexp for ARM target #148287

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

Felle33
Copy link

@Felle33 Felle33 commented Jul 11, 2025

Fixes #147485.
I changed the regexp for the ARM target making the part @+[ \t]*@"?(?P=func)"? optional since when the -asm-verbose=false is passed it is not generated and this led to the issue.
I have tried to use this new version with the tests that used the -asm-verbose=false, these are the results:

  • 2009-08-21-PostRAKill2.ll, 2009-08-21-PostRAKill3.ll: runtime error (UnboundLocalError), there was the same error also in the previous commit
  • 2011-02-04-AntidepMultidef.ll, 2011-02-07-AntidepClobber.ll, ifcvt-iter-indbr.ll: the update removes the file_check directives
  • arm-vld1.ll, arm-vlddup-update.ll, arm-vst1.ll, atomic-cmpxchg.ll, float-helpers.ll, fp16-fullfp16.ll: the update works
  • arm-vlddup.ll, tail-dup.ll, tail-opts.ll: adds some notes generated by update_llc_test_checks, but the update works
  • fp16-promote.ll, cse-flags.ll: in these files there are some file_checks directives outside the function and this leads to an error since the update script rewrites the directives inside the function.
  • fp16-vld.ll: some spaces are added, but the update works.

Should I fix also the 2011-02-04-AntidepMultidef.ll, 2011-02-07-AntidepClobber.ll, ifcvt-iter-indbr.ll tests?
Moreover I did not found the aarch64 tests that you mentioned.

Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Member

llvmbot commented Jul 11, 2025

@llvm/pr-subscribers-testing-tools

Author: Tommaso Fellegara (Felle33)

Changes

Fixes #147485.
I changed the regexp for the ARM target making the part @+[ \t]*@"?(?P=func)"? optional since when the -asm-verbose=false is passed it is not generated and this led to the issue.
I have tried to use this new version with the tests that used the -asm-verbose=false, these are the results:

  • 2009-08-21-PostRAKill2.ll, 2009-08-21-PostRAKill3.ll: runtime error (UnboundLocalError), there was the same error also in the previous commit
  • 2011-02-04-AntidepMultidef.ll, 2011-02-07-AntidepClobber.ll, ifcvt-iter-indbr.ll: the update removes the file_check directives
  • arm-vld1.ll, arm-vlddup-update.ll, arm-vst1.ll, atomic-cmpxchg.ll, float-helpers.ll, fp16-fullfp16.ll: the update works
  • arm-vlddup.ll, tail-dup.ll, tail-opts.ll: adds some notes generated by update_llc_test_checks, but the update works
  • fp16-promote.ll, cse-flags.ll: in these files there are some file_checks directives outside the function and this leads to an error since the update script rewrites the directives inside the function.
  • fp16-vld.ll: some spaces are added, but the update works.

Should I fix also the 2011-02-04-AntidepMultidef.ll, 2011-02-07-AntidepClobber.ll, ifcvt-iter-indbr.ll tests?
Moreover I did not found the aarch64 tests that you mentioned.


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

1 Files Affected:

  • (modified) llvm/utils/UpdateTestChecks/asm.py (+1-1)
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 3754aa2eeba85..ee70d837d7b7a 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -32,7 +32,7 @@ class string:
 )
 
 ASM_FUNCTION_ARM_RE = re.compile(
-    r'^(?P<func>[0-9a-zA-Z_$]+):[ \t]*@+[ \t]*@"?(?P=func)"?\n'  # f: (name of function)
+    r'^(?P<func>[0-9a-zA-Z_$]+):[ \t]*(@+[ \t]*@"?(?P=func)"?)?\n'  # f: (name of function)
     r"(?:\.L(?P=func)\$local:\n)?"  # drop .L<func>$local:
     r"(?:\s*\.type\s+\.L(?P=func)\$local,@function\n)?"  # drop .type .L<func>$local
     r"\s+\.fnstart\n"  # .fnstart

@Felle33
Copy link
Author

Felle33 commented Jul 11, 2025

@RKSimon

@RKSimon
Copy link
Collaborator

RKSimon commented Jul 14, 2025

fp16-promote.ll, cse-flags.ll: in these files there are some file_checks directives outside the function and this leads to an error since the update script rewrites the directives inside the function.

This is pretty common - the update script shouldn't touch comments outside functions so if the original CHECKS were put above the function then they won't get stripped and the lit test will fail as it ends up with duplicate checks - if a test file doesn't already have the "Assertions have been autogenerated by utils/update_llc_test_checks.py" note I wouldn't worry.

@RKSimon RKSimon requested review from RKSimon and jrtc27 July 14, 2025 08:52
@RKSimon
Copy link
Collaborator

RKSimon commented Jul 14, 2025

@jrtc27 please can you review - I think #139844 introduced the regression - should the other arm/thumb regexp be updated similarly?

@RKSimon RKSimon requested review from lenary and MaskRay July 14, 2025 08:58
@jrtc27
Copy link
Collaborator

jrtc27 commented Jul 14, 2025

@jrtc27 please can you review - I think #139844 introduced the regression - should the other arm/thumb regexp be updated similarly?

I assume so. Currently travelling but will take a look when I can this week. I think I copied this from another target’s but it’s possible I had to edit it and botched that.

@Felle33
Copy link
Author

Felle33 commented Jul 15, 2025

Is there something I can do on my side? I could work on the AArch64 files, but I have not found a file that was updated with the script and the flag --asm-verbose=false was passed at the same time

@RKSimon
Copy link
Collaborator

RKSimon commented Jul 15, 2025

Can you update the other regex patterns that were updated in the same patch?

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.

[Utils] update_llc_test_checks.py - failure to generate checks for -asm-verbose=false tests
4 participants