Skip to content

Commit ac466c7

Browse files
authored
UpdateTestChecks: squelch warning on SCEV output (#67443)
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.
1 parent 9eebfa8 commit ac466c7

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Basic test checking that update_analyze_test_checks.py works correctly
2-
# RUN: cp -f %S/Inputs/basic.ll %t.ll && %update_analyze_test_checks %t.ll
3-
# RUN: diff -u %t.ll %S/Inputs/basic.ll.expected
2+
# RUN: cp -f %S/Inputs/scev.ll %t.ll && %update_analyze_test_checks %t.ll
3+
# RUN: diff -u %t.ll %S/Inputs/scev.ll.expected
44
## Check that running the script again does not change the result:
55
# RUN: %update_analyze_test_checks %t.ll
6-
# RUN: diff -u %t.ll %S/Inputs/basic.ll.expected
6+
# RUN: diff -u %t.ll %S/Inputs/scev.ll.expected

llvm/utils/UpdateTestChecks/common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,11 @@ def process_run_line(
767767
)
768768
if "analysis" in m.groupdict():
769769
analysis = m.group("analysis")
770-
if analysis.lower() != "cost model analysis":
770+
supported_analyses = {
771+
"cost model analysis",
772+
"scalar evolution analysis",
773+
}
774+
if analysis.lower() not in supported_analyses:
771775
warn("Unsupported analysis mode: %r!" % (analysis,))
772776
if func.startswith("stress"):
773777
# We only use the last line of the function body for stress tests.

0 commit comments

Comments
 (0)