Skip to content

UpdateTestChecks: squelch warning on SCEV output #67443

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
merged 1 commit into from
Sep 26, 2023

Conversation

artagnon
Copy link
Contributor

@artagnon artagnon commented Sep 26, 2023

update_analyze_test_checks.py currently outputs a warning when updating a script with the run line:

  $ opt -passes='print<scalar-evolution>'

saying that the script doesn't support its output, when it indeed does, as evidenced by several tests in test/Analysis/ScalarEvolution generated by this script. There is even a test for update_analyze_test_checks that makes sure that SCEV output is supported. Hence, squelch the warning.

While at it, rename the update_analyze_test_checks test from basic.ll to a more explicit scev.ll.

@llvmbot
Copy link
Member

llvmbot commented Sep 26, 2023

@llvm/pr-subscribers-testing-tools

Changes

update_analyze_test_checks.py currently outputs a warning when updating a script with the run line:

  $ opt -passes='print&lt;scalar-evolution&gt;'

saying that the script doesn't support its output, when it indeed does, as evidenced by several tests in test/Analysis/ScalarEvolution generated by this script. There is even a test for update_analyze_test_checks that makes sure that SCEV output is supported. Hence, squelch the warning.

While at it, rename the update_analyze_test_checks test from basic.ll to a more explicit scev.ll.


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

4 Files Affected:

  • (renamed) llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/scev.ll ()
  • (renamed) llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/scev.ll.expected ()
  • (renamed) llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/scev.test (+3-3)
  • (modified) llvm/utils/UpdateTestChecks/common.py (+2-1)
diff --git a/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/scev.ll
similarity index 100%
rename from llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll
rename to llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/scev.ll
diff --git a/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll.expected b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/scev.ll.expected
similarity index 100%
rename from llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll.expected
rename to llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/scev.ll.expected
diff --git a/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/basic.test b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/scev.test
similarity index 51%
rename from llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/basic.test
rename to llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/scev.test
index 78f9646871efb68..413951f14da31b6 100644
--- a/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/basic.test
+++ b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/scev.test
@@ -1,6 +1,6 @@
 ## Basic test checking that update_analyze_test_checks.py works correctly
-# RUN: cp -f %S/Inputs/basic.ll %t.ll && %update_analyze_test_checks %t.ll
-# RUN: diff -u %t.ll %S/Inputs/basic.ll.expected
+# RUN: cp -f %S/Inputs/scev.ll %t.ll && %update_analyze_test_checks %t.ll
+# RUN: diff -u %t.ll %S/Inputs/scev.ll.expected
 ## Check that running the script again does not change the result:
 # RUN: %update_analyze_test_checks %t.ll
-# RUN: diff -u %t.ll %S/Inputs/basic.ll.expected
+# RUN: diff -u %t.ll %S/Inputs/scev.ll.expected
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index 22c05322d9c7dbc..264c4a4aefbf805 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -767,7 +767,8 @@ def process_run_line(
             )
             if "analysis" in m.groupdict():
                 analysis = m.group("analysis")
-                if analysis.lower() != "cost model analysis":
+                supported_analyses = {"cost model analysis", "scalar evolution analysis"}
+                if analysis.lower() not in supported_analyses:
                     warn("Unsupported analysis mode: %r!" % (analysis,))
             if func.startswith("stress"):
                 # We only use the last line of the function body for stress tests.

@github-actions
Copy link

github-actions bot commented Sep 26, 2023

✅ With the latest revision this PR passed the Python code formatter.

update_analyze_test_checks.py currently outputs a warning when updating
a script with the run line:

  $ opt -passes='print<scalar-evolution>'

saying that the script doesn't support its output, when it indeed does,
as evidenced by several tests in test/Analysis/ScalarEvolution generated
by this script. There is even a test for update_analyze_test_checks that
makes sure that SCEV output is supported. Hence, squelch the warning.

While at it, rename the update_analyze_test_checks test from basic.ll to
a more explicit scev.ll.
@artagnon artagnon force-pushed the scev-update-analyze-test branch from 66b303e to b0c16fa Compare September 26, 2023 15:59
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

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

LGTM

@artagnon artagnon merged commit ac466c7 into llvm:main Sep 26, 2023
@artagnon artagnon deleted the scev-update-analyze-test branch September 26, 2023 18:40
legrosbuffle pushed a commit to legrosbuffle/llvm-project that referenced this pull request Sep 29, 2023
update_analyze_test_checks.py currently outputs a warning when updating
a script with the run line:

  $ opt -passes='print<scalar-evolution>'

saying that the script doesn't support its output, when it indeed does,
as evidenced by several tests in test/Analysis/ScalarEvolution generated
by this script. There is even a test for update_analyze_test_checks that
makes sure that SCEV output is supported. Hence, squelch the warning.

While at it, rename the update_analyze_test_checks test from basic.ll to
a more explicit scev.ll.
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.

3 participants